bcd Posted April 1, 2014 Share Posted April 1, 2014 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? Quote Link to comment
Hippocode Posted April 1, 2014 Share Posted April 1, 2014 Can you post the code that creates the object ? Quote Link to comment
bcd Posted April 2, 2014 Author Share Posted April 2, 2014 Thanks for looking at it. When I have a moment I'll post some code. Quote Link to comment
bcd Posted April 2, 2014 Author Share Posted April 2, 2014 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); Quote Link to comment
Hippocode Posted April 3, 2014 Share Posted April 3, 2014 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. Quote Link to comment
bcd Posted April 3, 2014 Author Share Posted April 3, 2014 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). Quote Link to comment
bcd Posted April 3, 2014 Author Share Posted April 3, 2014 Ah I see, We need another tool to create the objects - this should work now thanks. Quote Link to comment
Hippocode Posted April 4, 2014 Share Posted April 4, 2014 If you want to keep the original poly you get the path from, don't forget to duplicate that path before using it in another PIO, otherwise you will sort of "cut" the path out of it. Quote Link to comment
Recommended Posts
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.