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
Solved! Go to Solution.
Solved by thomaskennedy. Go to Solution.
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
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
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