Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programatically create Virtual Component

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
truscher
1141 Views, 3 Replies

Programatically create Virtual Component

Hello All,

 

I am trying to use iLogic to programatically create virtual components in an assembly. These components will by used as iProperty "buckets" to hold Machine Center specific information to be exported to production planning software. This information is hierarchical in nature and cannot be (conveniently) stored in the assembly iproperties directly. I cannot find any info on doing this, so maybe one of the guru's here will come to the rescue. This would be a huge jump for our organization, so all help or sugestions will be appreciated!

 

Regards,

Tom

3 REPLIES 3
Message 2 of 4
thomaskennedy
in reply to: truscher

I've created something similar, here's an example :

 

Dim oAsm As AssemblyDocument = ThisDoc.Document
Dim oMatrix As Matrix = ThisApplication.TransientGeometry.CreateMatrix

Dim oOcc As ComponentOccurrence
oOcc = oAsm.ComponentDefinition.Occurrences.AddVirtual("EXAMPLE", oMatrix)

Dim oCompDefVirtual As VirtualComponentDefinition = oOcc.Definition

'CREATE AND SET THE IPROP
Dim oPropertySet As PropertySet = oCompDefVirtual.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}") oProperty = oPropertySet.Add("EXAMPLE VALUE", "EXAMPLE_PROPERTY")

 

That shows how to create the virtual component called EXAMPLE and add an iProperty (EXAMPLE to it.

 

Hopefully it should do what you want.

 

Cheers,

Tom

Message 3 of 4
truscher
in reply to: truscher

Thanks! I gave this a try and it works as advertised! This will be incredibly helpful, now for the work to begin....

 

Regards,

Thomas Ruscher

Message 4 of 4
truscher
in reply to: thomaskennedy

Tom, as you have mentioned you have done something similar, do you know how to access virtual components iproperties through a Global Form? I have been able to access them by getting the occurance name of the user selected virtual compent and using an inputbox, but this only allows for one property to be edited at a time. I would like to edit as many as 10 iproperties from a single dialog as they all relate to each other and it would be inconvenient to say the least for the user to enter them 1 at a time. Is there a way to have a multiple entry input box? The forms I have tried only find iproperties of the parent assembly.

 

Regards,

Thomas Ruscher

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report