Jump to content
Developer Wiki and Function Reference Links ×

List of records attached to objectdefinition


Hippocode

Recommended Posts

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 by hippothamus
Link to comment
  • Vectorworks, Inc Employee

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.

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