Hippocode Posted February 19, 2014 Share Posted February 19, 2014 (edited) I'm trying to get a list of all records attached to an object. The catch in this one is that I need it from a PIO the same way one would get records from a SymbolDEFINITION. All I have is the name of the object. I only try to get this list when there is atleast one object inside the drawing. GetObject(name) returns a handle to its parametric record. CreateCustomObject(name,0,0,0) returns a valid handle, but for some reason it only has 1 record ( parametric ) attached even though the code of that object uses SetRecord to assign more. Using foreachobject would first loop trough them all when I only need one and might give me a false list of records compared with the object definition Any other way ? Edited February 19, 2014 by hippothamus Quote Link to comment
Vectorworks, Inc Employee klinzey Posted February 19, 2014 Vectorworks, Inc Employee Share Posted February 19, 2014 You should be able to use NumRecords() and GetRecord() to access all the records attached to an object including the parameter record. Remember with CreateCustomObject() the code doesn't actually run to create the object (therefore the other records) till the currently running script is finished so the other records won't exist immediately after creating the object via script. The only record that exists immediately is the parameter record filled with the document defaults. Quote Link to comment
JBenghiat Posted February 19, 2014 Share Posted February 19, 2014 Also, objects created with CreateCustomObject() don't identify themselves as new. I think the idea is that if you are creating objects via script, you have total control over that object's init. Your create code should attach records, set scripted defaults, etc. -Josh Quote Link to comment
Hippocode Posted February 20, 2014 Author Share Posted February 20, 2014 Allrighty, I'll just select one trough "foreachobject" 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.