×
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

3d curve macro recording not working in catia vba

3d curve macro recording not working in catia vba

3d curve macro recording not working in catia vba

(OP)

i have been trying to record the creation of a 3d curve using control points in catia using the macro recorder but it refuses to record anything except part.update. I even tried it in both Freestyle workbench and Digitized shape editor workbench, but both have same result. please could someone explain to me how to do it or atleast where i could find such macro.

RE: 3d curve macro recording not working in catia vba

you should check the v5automation.chm, the answer is there.

Eric N.
indocti discant et ament meminisse periti

RE: 3d curve macro recording not working in catia vba

(OP)
Thanks for the reply. I did as as you advised and checked the file, however, i couldn't find anything. It might also be that i dont kow the exact words to search for. But i did search and check every result that had to with 3D Curve, 3D Spline, Record Macro as well as NURBS creation. However i couldn't find any useful information on them. Do you know any or did you find any? Please i would appreciate the help.

RE: 3d curve macro recording not working in catia vba

if not in v5automation.chm file then it is not available. Freestyle API are not open... if you need them, talk to DS. This is not free, DS will ask for $$$ to make it available to you.

Eric N.
indocti discant et ament meminisse periti

RE: 3d curve macro recording not working in catia vba

@Hadiza Hamza
Have you tried removing the points and re-adding them? Also in your specific scenario could you just recreate the 3D curve?





Drew Mumaw
www.textsketcher.com
www.drewmumaw.com

RE: 3d curve macro recording not working in catia vba

(OP)
@drewmumaw

I am not trying to create a normal 2D spline which one can use the addNewSpline method for, but the 3D Curve which uses control points to guide its path. I have checked the object browser and it is not part of the index. I was told that when it is not in the Object browser that it could not be automated. I have also seen it being discussed as one of the features of catia that could only be automated using CAA RADE.

RE: 3d curve macro recording not working in catia vba

i know that some freestyle function do not have API available, even in CAA. That's why some people are using non catia libraries (http://www.smlib.com/nlib.html) and import geometry in catia.

Eric N.
indocti discant et ament meminisse periti

RE: 3d curve macro recording not working in catia vba

@Hadiza Hamza
AddNewSpline() can create a 3D curve if you use non-planar points. See code below that uses 3 points to create a 3D curve (in this example I already created 3 points in a geometrical set in CATIA, but you could create them in your own script to make it fully automated).

CODE --> catvba

Sub CATMain()

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory

Dim hybridShapeSpline1 As HybridShapeSpline
Set hybridShapeSpline1 = hybridShapeFactory1.AddNewSpline()

hybridShapeSpline1.SetSplineType 0

hybridShapeSpline1.SetClosing 0

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")

Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = hybridBody1.HybridShapes

Dim hybridShapePointCoord1 As HybridShapePointCoord
Set hybridShapePointCoord1 = hybridShapes1.Item("Point.1")

Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(hybridShapePointCoord1)

hybridShapeSpline1.AddPointWithConstraintExplicit reference1, Nothing, -1#, 1, Nothing, 0#

Dim hybridShapePointCoord2 As HybridShapePointCoord
Set hybridShapePointCoord2 = hybridShapes1.Item("Point.2")

Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(hybridShapePointCoord2)

hybridShapeSpline1.AddPointWithConstraintExplicit reference2, Nothing, -1#, 1, Nothing, 0#

Dim hybridShapePointCoord3 As HybridShapePointCoord
Set hybridShapePointCoord3 = hybridShapes1.Item("Point.3")

Dim reference3 As Reference
Set reference3 = part1.CreateReferenceFromObject(hybridShapePointCoord3)

hybridShapeSpline1.AddPointWithConstraintExplicit reference3, Nothing, -1#, 1, Nothing, 0#

hybridBody1.AppendHybridShape hybridShapeSpline1

part1.InWorkObject = hybridShapeSpline1

part1.Update

End Sub 



Drew Mumaw
www.textsketcher.com
www.drewmumaw.com

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