Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.
does anybody knows ohw i ca n instantiate a powercopy from VB. I don't want to do the example find in the help (instaniate directly parameters in VB), i juste want to start the command with a spcecific file which contains the powercopy.
Here is a code example for instatiation of a power copy from a Macro.
You will need to adapt it to your needs
Sub CATMain
Dim PartDocumentDest As PartDocument
Set PartDocumentDest = CATIA.ActiveDocument
Dim PartDest As Part
Set PartDest = PartDocumentDest.Part
Dim factory As InstanceFactory
Set factory = PartDest.GetCustomerFactory("InstanceFactory")
factory.BeginInstanceFactory Pc_Name, Pc_Path 'Power Copy Name and File Location on hard drive
factory.BeginInstantiate
Dim ISArr As Object
Set ISArr = PartDest.FindObjectByName("ISArr") 'Name of object here
Dim ISTemp As Object
Set ISTemp = PartDest.FindObjectByName("ISTemp") 'Name of object here
factory.PutInputData "ISArr", ISArr 'Name of Power Copy input linked to object
factory.PutInputData "ISTemp", ISTemp 'Name of Power Copy input linked to object
Dim Instance As ShapeInstance
Set Instance = factory.Instantiate
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.