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
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!
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
drawingSheet1.PaperSize = catPaperA0
drawingSheet1.Scale = 1.000000
drawingSheet1.Orientation = catPaperLandscape
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Create a Drawing
I want also to show 3D points! and change axis properties and rename references! if its possible?
RE: Create a Drawing
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
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.indocti discant et ament meminisse periti