Jump to content
Developer Wiki and Function Reference Links ×

Create Custom Object from Shapes


bcd

Recommended Posts

My script command is creating a custom object from an existing polyline (selected via LSActLayer ) but running into the issue where the resulting objects are creating correctly but as primitives (circles squares etc) rather than as within a PIO that I can then edit via the OIP.

What am I missing?

Link to comment

The object is already created & selected -

Any new objects created in this script will also be drawn outside the PIO

I guess the behavior I'm looking for is one similar to the built in Create Objects from Shapes command - where a polygon can be converted into e.g. a Ceiling Grid.

PROCEDURE Test;

{ideally parameter R would be available as a field in the OIP of this PIO}

VAR

h1 :HANDLE;

BEGIN

h1:= LSActLayer;

ROTATE(12*pR);

END;

Run(Test);

Link to comment

When creating an object based on a polyline you should:

- Get the path handle of this polyline

- CreateCustomObject() Create a handle to the new object

- SetCustomObjectPath() Sets the path of this new object to match the path of the polyline

- Delete the poly if requested.

Any other objects you "create" within this script won't be a part of your new customobject because they aren't a part of the custom objects's code.

You could of course get more information out the polyline or combination of polylines/objects

( f.e. getbbox to get the outer distance and some other calculations to get the distance between segments ).

Using SetRField these could be parameters of your customobject defining it.

Link to comment

Thank for your help hippothamus - this is what I needed.

I do need the newly created objects to be part of the PIO - much like the ceiling grid adds lines which can be adjusted via the OIP (and a control point which can be adjusted graphically).

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...