Jump to content
Developer Wiki and Function Reference Links ×

Regens & LayerScale


Recommended Posts

Whenever I go to the Create Plug-ins dialog, all the PIO's that I have (custom-made) reset themselves to the ACTIVE layer only. When I switch to another layer (different scale, so the PIO's are incorrectly scaled), moving the PIO doesn't fix it, but rotating does. Reset on Move is checked, as is Reset on Rotate. The regen check is as follows:

{"error-check for possible size changes in regens"} if IsNewCustomObject (this_object_name) or (GetLayer(this_object_handle)=NIL) { what does this check mean? } then LayerScale:=GetLScale(ActLayer) { set the scale var to the current doc scale } else LayerScale:=GetLScale(GetLayer(this_object_handle)); { retrieve scale of object's layer }

It's as though the GetLayer doesn't work correctly during a global PIO update. I originally grabbed the above check from a v8 Elevation Benchmark script. Can anyone help? Until then, I'll try to check if the placement of the code (and assignment to LayerScale) is the culprit.

Link to comment

OK, the trick is, add this to your plug-in:

ALHand:=ActLayer; IF GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand) THEN BEGIN IF GetLayer(objectHand)<>NIL THEN BEGIN Layer(GetLName(GetLayer(objectHand))); END; END;

[... your plug-in goes here...]

Layer(GetLName(ALHand));

The point is: have the layer made active at the time the plug-in is redrawn.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...