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!

text template that includes promted input

Status
Not open for further replies.

norkamus

Aerospace
May 15, 2012
76
Hi all. I'd like to be able to place, for example, the following text:

"ALL DIMENSIONS +/-0.010" UNLESS OTHERWISE SPECIFIED"

where the '+/-0.010" ' is the result of a prompt.

I have just started to become familiar with text templates but haven't found a way.

Nick

Light structural commercial aircraft parts
PCDMIS 4.3 CAD++, CATIA V5 R20, NX6
APM Consortium Inc.
Cambridge Ontario, Canada
 
Replies continue below

Recommended for you

I am not quite that good at scripting. I usually rely on the macro recording feature and figure it out from there but CATIA just gives me a blank module, no matter what I try to record. I fear I have little hope of just bashing a script together.

Any idea why macros won't record anything?

Nick

Light structural commercial aircraft parts
PCDMIS 4.3 CAD++, CATIA V5 R20, NX6
APM Consortium Inc.
Cambridge Ontario, Canada
 
Nick,
Ferdo has created a masterpiece of script examples. I clip little bits form it all the time.

Link


Regards,
Derek


Win XP64
R20/21, 3DVIA Composer 2012, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
 
DBezaire, thank you for that! I'll definitely be able to figure it all out now. Lot's of info to pour through.

Nick

Light structural commercial aircraft parts
PCDMIS 4.3 CAD++, CATIA V5 R20, NX6
APM Consortium Inc.
Cambridge Ontario, Canada
 
I'm gonna go out on a limb and ask if someone would be able to help me out with some scripting (ferdo..?). The above resources are great, but I learn better to see a script where I know what the intended outcome is. This is a little off topic of the thread but I am looking to create a script that will allow me to switch selected drawing views between (raster-high quality print, shaded with edges) and (exact view). I'd like to be able to just select the view, and run the script.

If someone could even get me started on what this script might look like, I might be able to fumble through with VBA's auto fill function (lot's of guessing...)


Nick



Light structural commercial aircraft parts
PCDMIS 4.3 CAD++, CATIA V5 R20, NX6
APM Consortium Inc.
Cambridge Ontario, Canada
 
Hi,

A quick, dirty solution to your first problem, which obviously can be improved (user should be able to pick a point in 2D drawing, also some input boxes to let user write what he wants, but this is not the case in the bellow CATScript). For your second problem I have to think...but I strongly encourage everyone to try to develop a code, post it and see together what can be done to improve the code (just an info, I'm not a programmer so believe me I'm also learning from others).

And maybe a new post it would be better.

Sub CATMain()

Set drawingDocument1 = CATIA.ActiveDocument
Set drawingSheets1 = drawingDocument1.Sheets
Set drawingSheet1 = drawingSheets1.Item("Sheet.1")
Set ActiveView = drawingSheet1.Views.Item(1)
Dim collection_textes As DrawingTexts
Set collection_textes = ActiveView.Texts
Dim Legende_texte As DrawingText


b = "ALL DIMENSIONS"
c= " +/-0.010" & "in"
d = " UNLESS OTHERWISE SPECIFIED"
Set Legende_texte = collection_textes.Add(b & c & d, 100, 100)

Legende_texte.SetFontSize 0, 0, 3.5

End Sub

Regards
Fernando

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor