Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Drawing

Status
Not open for further replies.

mayrou

Electrical
Jan 8, 2014
55
TN
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:
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!
 
Replies continue below

Recommended for you

thank you!
I want also to show 3D points! and change axis properties and rename references! if its possible?
 
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.

 
check your online doc...


DrawingView (Object)
[ul]
[li]GenerativeBehavior[/li]
[/ul]
Returns the generative behavior of the drawing view.

DrawingViewGenerativeBehavior (Object)
[ul]
[li]PointsProjectionMode( ) As CatPointsProjectionMode[/li]
[/ul]

Returns or sets projection mode for 3D points. This mode indicates whether to project 3D points.

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top