cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Automating various things in creating drawings.

Highlighted
Amethyst

Automating various things in creating drawings.

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

12 REPLIES 12
Highlighted

Re: Automating various things in creating drawings.

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.

Highlighted

Re: Automating various things in creating drawings.

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`;

Highlighted

Re: Automating various things in creating drawings.

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`;

Highlighted

Re: Automating various things in creating drawings.

Can this mapkey be used to copy the bom balloons to the next sheet as well?

Highlighted

Re: Automating various things in creating drawings.

I haven't read through all the responses (read them but not used the info) so far, but thanks for all the info. I will get through it all.

But in general, I mean working with many sheets inside one DRW, not creating DRWs. I'm not sure how to create views without a model in session, as when you try to place a general view with no model it automatically asked to load a model. So I am not sure how to create a template that contains this. Also, I do use templates and my experience is it works ok for creating one DRW per PRT (or ASM), but when you add sheets it doesn't copy anything to the next sheet except the format.

And yes was looking for a solution that doesn't involve hitting a mapkey 100 times, which is basically what I do now.

Again, I need to read through everything and do some more experimenting. Thanks.

Highlighted

Re: Automating various things in creating drawings.

Templates are for new drawings. You can create templates with multiple drawings sheets if needed. I don't think Creo has a great way of combining sheets from separate DRW files (it'd be nice if it did as there'd be all sorts of tricks you could do).

The mapkey I shared takes about 1 second per sheet  (you can have multiple tables/notes/symbols selected). 100 sheets = 100 seconds. Attached is a demo video of the mapkey if that helps. For something faster (programming) or with more capabilities, check out Christopher Rees' comment. API's are full programming integration while his other solutions are scripting programs.


Side note 1: Changing 100 sheets all at once also carries a risk of easily doing something wrong that may take a while to undo. At least when you're clicking through with a mapkey you can check if you should be pasting to each sheet.

Side note 2: Do you use 100 sheets because you're using Family Tables? We have some drawings with a hundred Family Table parts on them but we put most of the design information in Repeat Region tables driven by the Family Table info. The part views we do add are linked to the tables by variables (say the length of the parts are changing). This drastically reduces our drawing creation/maintenance time as we may only have 4-10 drawings sheets instead of 100. Possibly one other option to consider.

Highlighted

Re: Automating various things in creating drawings.

If your 100 sheets are all similarly designed, for various of the parts in your assembly perhaps, you could consider a drawing template for just that sheet, and a mapkey that makes a drawing using the template, then appends it to your master drawing (Layout tab, Insert > Import Drawing).

Highlighted

Re: Automating various things in creating drawings.

I guess you could say similar operations on different sheets (and different parts)? Not just a bunch of copies of the same thing. I am thinking what I want to do is slightly more advanced then macros.I could be wrong. And I think I only need a couple or few more things that would save me a ton of time setting up drawings. I already have a bunch of macros I use for 2D.

Highlighted

Re: Automating various things in creating drawings.

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

Highlighted

Re: Automating various things in creating drawings.

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!
Highlighted

Re: Automating various things in creating drawings.

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.

Highlighted

Re: Automating various things in creating drawings.

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.

Announcements