×
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

Create a Drawing

Create a Drawing

Create a Drawing

(OP)
Hello world!
I need to create a CATIA macro that create a drawing from a product automatically!
I already began this macro and i created the front view

CODE --> vbs

Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim drawingDocument1 As Document
Set drawingDocument1 = documents1.Add("Drawing")

Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets

Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.Item("Calque.1")

Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views

Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Add("AutomaticNaming")

Dim drawingViewGenerativeLinks1 As DrawingViewGenerativeLinks
Set drawingViewGenerativeLinks1 = drawingView1.GenerativeLinks

Dim drawingViewGenerativeBehavior1 As DrawingViewGenerativeBehavior
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior

Dim productDocument1 As Document
Set productDocument1 = documents1.Item("Mayrou.CATProduct")

Dim product1 As Product
Set product1 = productDocument1.Product

drawingViewGenerativeBehavior1.Document = product1

drawingViewGenerativeBehavior1.DefineFrontView -0.999967, 0.008088, 0.000000, 0.000000, 0.000000, 1.000000

drawingView1.x = 600
drawingView1.y = 500
drawingView1.Scale = 0.5

Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior
drawingViewGenerativeBehavior1.Update 

subsequently i want to show the format A0 and to define the isometric view! to change the format of axis and add references A ,B, C!

RE: Create a Drawing

(OP)
thank you!
I want also to show 3D points! and change axis properties and rename references! if its possible?

RE: Create a Drawing

I have yet to see a way to programatically change the setting that controls whether 3D Point show or not - while Catia is open.

Is pretty easy to do if you know a little VB and know how to copy files to new locations.
I know you didn't ask for an external solution; but, I'll offer it anyway in case someone might find it useful.
First, manually make your change and save off the CATSetting file that records that change. Save it off somewhere other than your local CATSettings folder.
Then write some code that copies that file to your local CATSettings folder and then opens Catia.
This is a pretty easy way to set up your Catia environment to be whatever you need it to be.

RE: Create a Drawing

check your online doc...


DrawingView (Object)
  • GenerativeBehavior
Returns the generative behavior of the drawing view.

DrawingViewGenerativeBehavior (Object)
  • PointsProjectionMode( ) As CatPointsProjectionMode
Returns or sets projection mode for 3D points. This mode indicates whether to project 3D points.

Eric N.
indocti discant et ament meminisse periti

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