×
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

Draft Form - Square

Draft Form - Square

Draft Form - Square

(OP)
Hi,

I have problem with VBScript. I need to use DRAFT in my model with option Draft Form -> Square. When I'm using GUI it is working fine but I need to implement it into VBScript but there is no such code for changing Draft Form form Cone to Square. If someone had similar problem please write me about it.

CODE --> VB

Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim shapeFactory1 As Factory
Set shapeFactory1 = part1.ShapeFactory

Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromName("")

Dim draft1 As Draft
Set draft1 = shapeFactory1.AddNewDraft(reference1, reference1, catNoneDraftNeutralPropagationMode, reference1, 0.000000, 0.000000, 1.000000, 0, 5.000000, 0)

Dim draftDomains1 As DraftDomains
Set draftDomains1 = draft1.DraftDomains

Dim draftDomain1 As DraftDomain
Set draftDomain1 = draftDomains1.Item(1)

draftDomain1.SetPullingDirection 0.000000, 0.000000, 1.000000

Dim bodies1 As Bodies
Set bodies1 = part1.Bodies

Dim body1 As Body
Set body1 = bodies1.Item("Body.2")

Dim shapes1 As Shapes
Set shapes1 = body1.Shapes

Dim constRadEdgeFillet1 As Shape
Set constRadEdgeFillet1 = shapes1.Item("EdgeFillet.5")

Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromBRepName("RSur:(Face:(Brp:(Pad.3;2);None:();Cf11:());WithTemporaryBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", constRadEdgeFillet1)

draftDomain1.AddFaceToDraft reference2

draftDomain1.NeutralPropagationMode = catSmoothDraftNeutralPropagationMode

Dim reference3 As Reference
Set reference3 = part1.CreateReferenceFromBRepName("RSur:(Face:(Brp:(Pad.3;0:(Brp:(Sketch.4;11)));None:();Cf11:());WithTemporaryBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", constRadEdgeFillet1)

draftDomain1.NeutralElement = reference3

draftDomain1.SetPullingDirection -0.000000, -0.000000, 1.000000

Dim pad1 As Shape
Set pad1 = shapes1.Item("Pad.3")

Dim reference4 As Reference
Set reference4 = part1.CreateReferenceFromBRepName("FSur:(Face:(Brp:(Pad.3;0:(Brp:(Sketch.4;13)));None:();Cf11:());WithTemporaryBody;WithoutBuildError;WithInitialFeatureSupport;MFBRepVersion_CXR15)", pad1)

draftDomain1.PullingDirectionElement = reference4

part1.Update 

End Sub 

Chears,
Konrad

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