×
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 for External Reference with VB.net and CATIAV5R21

Macro for External Reference with VB.net and CATIAV5R21

Macro for External Reference with VB.net and CATIAV5R21

(OP)
Hi!

I have the following Problem. I have a product which includes two parts. The first part includes the geometry (surfaces and planes) and the second part includes the actual part based on some of the geometry in the first part.
I'm trying to create an intersection between a plane and a surface which works absolutely fine when I'm doing it by Hand. The "External References" geometrical set is being created and no error is shown.
However, when I try to automate it, I get an error.

This works (if I previously selected the external reference manually, then it is within the external referenecs geometrical set):
reference_CPLANE = currentPart.CreateReferenceFromObject(hybridShapes_ExternalReferences.Item("C___35___A_15__PLN_A320-100"))
reference_LOFT = currentPart.CreateReferenceFromObject(hybridShapes_ExternalReferences.Item("FUSE_____A_15__JOI_A320-100"))

Dim interaction_guidingCurve As HybridShapeIntersection = hybridShapes_FrameProfileGeo.Item("Guidecurve Frame")

interaction_guidingCurve.Element2 = reference_LOFT
interaction_guidingCurve.Element1 = reference_CPLANE

This doesn't work (if I want to get it as an Parameter from another part):
Dim parameters_part_mastergeo_15_cplanes As KnowledgewareTypeLib.Parameters = part_mastergeo_15_cplanes.Parameters
Dim hybridShapePlane_CPLANE As HybridShapePlaneExplicit = parameters_part_mastergeo_15_cplanes.Item("C___35___A_15__PLN_A320-100")
Dim reference_CPLANE As Reference = part_mastergeo_15_cplanes.CreateReferenceFromObject(hybridShapePlane_CPLANE)

Dim interaction_guidingCurve As HybridShapeIntersection = hybridShapes_FrameProfileGeo.Item("Guidecurve Frame")
interaction_guidingCurve.Element1 = reference_CPLANE 'HERE's THE ERROR



PLEASE HELP ME!!! Thanks in advance

RE: Macro for External Reference with VB.net and CATIAV5R21

Hello,
During macros execution, you need to create a few more steps. When you need to bring references from another part, you need first to create a copy and then a paste as result (with link or not, depend from what you want). You can do this step using macro, there are several examples across internet.

I hope that I've helped you.

Tiago Figueiredo
Tooling Engineer

Youtube channel:
https://www.youtube.com/channel/UC1qdlBeJJEgMgpPLV...

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