×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro to instantiate a powercopy and isolate its design table

Macro to instantiate a powercopy and isolate its design table

Macro to instantiate a powercopy and isolate its design table

(OP)
Hello,

I used a macro in CATIA to instantiate a power copy which uses a design table. I was wondering how i could isolate the design table's link.
Once the power copy is made, i do not want the design table to be linked with my excel sheet on my server.

Here is the macro i used to instantiate the power copy (found in CATIA's documentation):

' Instantiation of a Power Copy Reference called "TwoSurfacicHole"
' TwoSurfacicHole is stored in the CATPart PowerCopyReference.CATPart"
' It has 3 inputs: FirstHole, Support,and SecondHole
' and 2 published parameters: Radius1 and Radius2
'--------------------------------------------------------------

'---------------------------------------------------------------
CATIA.SystemService.Print "Retrieve the current part"

Dim PartDocumentDest As PartDocument
Set PartDocumentDest = CATIA.ActiveDocument

Dim PartDest As Part
Set PartDest = PartDocumentDest.Part
'---------------------------------------------------------------
CATIA.SystemService.Print "Retrieve the factory of the current part"

Dim factory As InstanceFactory (A)
Set factory = PartDest.GetCustomerFactory("InstanceFactory")
'---------------------------------------------------------------
CATIA.SystemService.Print "BeginInstanceFactory" (1)

factory.BeginInstanceFactory "TwoSurfacicHole", "e:\tmp\PowerCopyReference.CATPart"
'---------------------------------------------------------------
CATIA.SystemService.Print "Begin Instantiation"

factory.BeginInstantiate (2)
'---------------------------------------------------------------
CATIA.SystemService.Print "Set Inputs"

Dim FirstHole As Object
Set FirstHole = PartDest.FindObjectByName("Point.1")

Dim Support As Object
Set Support = PartDest.FindObjectByName("Extrude.1")

Dim SecondHole As Object
Set SecondHole = PartDest.FindObjectByName("Point.2")

factory.PutInputData "FirstHole", FirstHole (3)
factory.PutInputData "Support", Support
factory.PutInputData "SecondHole", SecondHole
'---------------------------------------------------------------
CATIA.SystemService.Print "Modify Parameters"

Dim param1 As Parameter
Set param1 = factory.GetParameter("Radius1") (4)
param1.ValuateFromString("25mm")

Dim param2 As Parameter
Set param2 = factory.GetParameter("Radius2")
param2.ValuateFromString("15mm")
'---------------------------------------------------------------
CATIA.SystemService.Print "Instantiate" (5)

Dim Instance As ShapeInstance
Set Instance = factory.Instantiate
'---------------------------------------------------------------
CATIA.SystemService.Print "End of Instantiation"
factory.EndInstantiate (6)
'---------------------------------------------------------------
CATIA.SystemService.Print "Release the reference document"

factory.EndInstanceFactory (7)
'---------------------------------------------------------------
CATIA.SystemService.Print "Update"
PartDest.Update

Thank you!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources