×
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

text template that includes promted input

text template that includes promted input

text template that includes promted input

(OP)
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

RE: text template that includes promted input

(OP)
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

RE: text template that includes promted input

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

RE: text template that includes promted input

(OP)
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

RE: text template that includes promted input

No problem Nick. I did send you to an older version.

Try this one, it should be the Portable Script Center V2.0

http://www.eng-tips.com/viewthread.cfm?qid=298847

Win XP64
R20/21, 3DVIA Composer 2012, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB

RE: text template that includes promted input

(OP)
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

RE: text template that includes promted input

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

https://picasaweb.google.com/102257836106335725208

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