Skip to main content
14-Alexandrite
March 8, 2017
Question

Automating various things in creating drawings.

  • March 8, 2017
  • 3 replies
  • 10629 views

Creating 2D currently consumes way too much of my time,and I feel I have not done something about this for way too long, and need some help if there are simple answers to some of this already. I think most of this is just a touch past being able to use macros, but I could be wrong. But even if I have to write code or pay someone to write for me, it's will help in the long run.

1. How can you add a general view and then have 2 projection views on all 4 sides?

2. How can I can I automate copying things to more sheets, say I have 24 sheets, and I am on sheet 7 and I want to copy a note or table to the rest of the sheets?

3. Can a macro automatically switch sheets and repeat? Without having to write a macro that specifically does sheet per sheet. Meaning I know I can write a macro that does something on each sheet but it's per DRW, like if I write a macro while a DRW has 20 sheets to do something, it will work, but say my next project has 100 sheets, then it's not going to work.

I am sure there is more that I am forgetting at the moment. Any tips on how people speed up 2d creation would be great.

thanks

3 replies

12-Amethyst
March 8, 2017

For (1), if you want generally to make lots of drawings with a particular layout of general + 4 projection views, the best way is to make a drawing template.  File>New>Drawing, put the desired size and format, Tools>Template to get into template creation mode, and put in what you'd like, especially Layout>Template View for views to instantiate. To use the template, File>New Drawing>Use template.  You can also have the template include title block, BOM table showing balloons, making snap lines automatically, etc. if desired.

For (2), we usually expect people to make sheets that want duplicated content to make it at the beginning, and have it in the format or template or use Layout > Move or Copy Sheets.  But here's a way to do it with mapkeys:

First, use File > Options > Customize Ribbon, take the command Go to Sheet... from More Commands, and put it in the toolbar.

Then make your mapkey:  Paste, Go to Sheet, Next, Close.  This mapkey can then be invoked repeatedly to paste the copy/paste buffer onto each sheet in turn.

For (3), the mechanism in (2) will work, though you'll need to hit the mapkey button 100 times.  There isn't a 'for each sheet' or other programmatic structure in mapkeys.

17-Peridot
March 8, 2017

I'd echo Matthew Ender's approach of using Drawing templates and mapkeys.

You can create Drawing Templates to your hearts content with as many views, settings for each view if needed, as many sheets as needed etc. and having them all use one Drawing Format if desired. I put some lessons learned for templates here at the end: Re: Any Lessons Learned to Implement Drawing Templates?

Mapkeys are awesome tools to speed things up especially with drawings I put some lessons learned for mapkeys here: Mapkey Writing/Editing Tips

For 1: you could use Drawing Templates if you're creating new drawings or mapkeys to add views to existing drawings. I have a mapkey that quickly adds 3 views (one general view with 2 projects) with 4 button clicks (and changes the view settings as well). It seems like it would be possible to create a mapkey for as many views as you would need but you'd have to click to locate each view.

For 2: For a "copy and paste to next sheet" mapkey, I would use the Copy>Paste using absolute coordinates which would allow you to drop it at the same location on every drawing sheet if you use the default 0,0 for both the copy and paste. This way you'd only have to set the drawing sheet location once.

absolute coordinates.jpg

For 3: Seems like Creo prevents you from writing multiple circular referencing mapkeys so you'll probably have to activate the mapkey 100 times. It may be easier to add the mapkey as a button to the Creo interface or make the mapkey name really short like 'cc'. You'll have to keep track when you get back to the first sheet you started on.

Here's a Creo 3 M060 mapkey that I was testing it on. You may have to rewrite it to fit your Creo version. You'll have to have the object selected before trying to copy.

mapkey cc @MAPKEY_NAMEPaste Selected to Next Sheet;\

mapkey(continued) @MAPKEY_LABELPaste Selected to Next Sheet (cc);\

mapkey(continued) ~ Command `ProCmdEditCopy@PopupMenuGraphicWinStack`;\

mapkey(continued) ~ Command `ProCmdDwgGotoSheet`;\

mapkey(continued) ~ Activate `gotosheet` `Next`;\

mapkey(continued) ~ Activate `gotosheet` `Close`;\

mapkey(continued) ~ Command `ProCmdEditPaste@PopupMenuGraphicWinStack`;\

mapkey(continued) ~ Select `dwg_selpnt_dlg` `rad_sel_method` 1 `abs_coord`;\

mapkey(continued) ~ Activate `dwg_selpnt_dlg` `psh_ok`;\

mapkey(continued) ~ Select `dwg_selpnt_dlg` `rad_sel_method` 1 `abs_coord`;\

mapkey(continued) ~ Activate `dwg_selpnt_dlg` `psh_ok`;

Inoram14-AlexandriteAuthor
14-Alexandrite
March 24, 2017

Ok! I just had some time to mess with this, the macro you posted did not work in Creo2 M240, But it was simple enough to remake real quick. Which is below.

I like it, it will be helpful. Thanks.

I still need to research for I guess a lack of better terminology some more advanced automation things.

mapkey cc @MAPKEY_NAMEcopy/paste selected;@MAPKEY_LABELcopy/paste selected;\

mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\

mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;~ Command `ProCmdEditCopy`

mapkey(continued) ~ Command `ProCmdDwgGotoSheet` ;~ FocusOut `gotosheet` `InpPagenum`;\

mapkey(continued) ~ Activate `gotosheet` `Next`;~ Activate `gotosheet` `Close`;\

mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\

mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;~ Command `ProCmdEditPaste`

mapkey(continued) ~ Select `dwg_selpnt_dlg` `rad_sel_method` 1 `abs_coord`;\

mapkey(continued) ~ FocusOut `dwg_selpnt_dlg` `opt_abs_x`;~ Activate `dwg_selpnt_dlg` `psh_ok`;\

mapkey(continued) ~ Select `dwg_selpnt_dlg` `rad_sel_method` 1 `abs_coord`;\

mapkey(continued) ~ FocusOut `dwg_selpnt_dlg` `opt_abs_x`;~ Activate `dwg_selpnt_dlg` `psh_ok`;

Chris3
21-Topaz I
March 8, 2017

The APIs (weblink, VB, JLink, toolkit) are options as well although they are for programmers only.

You can also record a mapkey and then use another tool to automate modifying it for other cases. I write vbs to generate mapkeys, but there are other tools that have been mentioned which you can look into:

AutoIt: AutoIT Hole UI Scripts you may find useful.

https://www.google.com/search?q=site%3Aptcusercommunity.com+AutoIt

TrailMaker: Trailmaker 0.3

AutoHotKey: https://www.google.com/search?q=site:ptcusercommunity.com+AutoHotKey&*

Batch Files: Batch file that runs same trail file on multiple parts

17-Peridot
March 26, 2017

Drafting is the butter for the bread I baked with ideas and modeling.

Drafting of high tech components and precision assemblies has defined much of my career.

Although a big drawing is maybe 3 sheets for me, I have not found anything I would automate.

The best solutions to date are:

  • Do not use GD&T religiously; symbols look the very same on a PDF drawing.
  • No two drawings are alike; similar requires closer look.
  • I do not use intelligent formats; I copy/paste annotation from one drawing to the next.  Solves a lot of back and forth for fixing parameters.
  • Shortcut keys are probably the only addition that could improve my throughput.  Never liked them!
Inoram14-AlexandriteAuthor
14-Alexandrite
March 26, 2017

I hear ya, but I spend more time in 2D then 3D in reality, on most projects. And thinking about it 90% maybe even 100% of my mapkeys are for 2D work.

I downloaded and wrote some stuff in AutoIt. I mean I wrote things to learn it, not things I can actually use. And it's pretty sweet, but I guess without a direct API into Creo it's very limited. And I'm not an expert with it, that's just what I have gathered from a few hours of messing with it.

I was going to try to use the ImageSearch stuff in AutoIt to try to find stuff on the Creo GUI, I don't even know if that would work but I guess support for it was dropped at some point from the AutoIt team? And some other people got it working but it just seemed less elegant.

So I started looking at VB, but I have run out of time to mess with it for now(again) and have to get some stuff done. So maybe another week or 2 I can look into it again.

1-Visitor
March 26, 2017

I think ImageSearch is not an AutoIt team development but an independently developed tool. There's a forum page that discusses usage on Win10 with active posts at the end of February so it is still a going concern.

The best way I've used AutoIt is to create mapkeys in Creo and then use AutoIt to fire them off or to dynamically create mapkeys/trail files. The less time I could spend trying to determine the state Creo was in at any time the better.