DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Macro to pre-set text , arrow, and dimension options proportional to text size.

Started by Rob S, February 05, 2008, 11:19:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rob S

Due to the number of parameters that must be set, starting with V17, and again more so with V18, and the absence of the "paste" command, Bdeck responded with an ingenious macro to pre-set all of these parameters proportionally to text size.

His version was designed for V17, so I added the parts to make it work in V18, and we polished it up together. I also added the option to set the dimension text format for all types at the same time.

This latest version has added the input initial text size to the opening dialog, and I took out an anykey statement which made it not terminate properly.  In response to an earlier comment, I added a parameter to set the extension lines to "variable", which can be edited in the macro as well.

All of the proportions relating arrowhead size, gaps, offsets, etc to text size can be edited in the first few lines of the macro, and these will be applied to all types of dimensions.

This version has been tested on V15.3, V17.2, and V18.1 and seems to work correctly.

Please let us know any issues you find, or improvements you would like.

Feb 07, 2008 - gosub changed to goto for those who care
User since forever

Rob S

The enclosed version of our MACRO has been updated to work with V18.2, which is now available, and it should still work with all previous versions - tested on 15.3, 17.2, and 18.1.

This testing took place in a hurry late in the evening after a couple of glasses of wine, so please let me know any issues which may arise  ;D ;D

With valuable input from the Troll, it has been revised so it does not actually draw any entities into your drawing, and therefore does not have to erase anything.

The previous version might have caused some issues for people who had their axis set different than default, this one should work in any case.

If you don't like the "finished" message at the end, you can comment out the last couple of lines.

[Apr 11 - I have uploaded a corrected copy  with the description line for fixed/variable extension lines corrected as pointed out below - the operation has not changed] 
User since forever

bdeck

Quote from: Rob Schippers on April 10, 2008, 09:39:40 PM

With valuable input from the Troll, it has been revised so it does not actually draw any entities into your drawing, and therefore does not have to erase anything.



Hi Rob,

Thanks for the update.

Cool info on the Null parameter.

It seems to have been there all along.

Very useful. 

Who knew?

BD

Bob P

I can't seem to get the gap factor (gap between object and extension line) to be greater than zero...

V18.2

prl

Bob P, seems to work for me.  Try using a different setting for the gptf variable in the code.  Keep in mind, Rob has all the ratios tied to the text size.



Edit - not sure if it is a typo in Rob's code or if IMSI reversed the flag condition but note the bold code.  You need to have the extfmt = 0.  I corrected the text in the below.

aptf=.8      ' arrow size factor   ***** change this line if necessary for earlier versions
gptf= 1     ' gap factor sets gap between object and extension line
extfmt=0     ' extension line fixed = 1 variable = 0 
xptf=.5      ' extension line overshoot factor   
Locn=0       ' Text location
Prcn=3       ' precision
optf=.25     ' text offset from dim line work on v 18 only
bptf=1.5     ' baseline dimline spacing on v 14 to 17 (does not work on V18.1 - bug)
at2=4        ' arrowhead type:   NOTE this is not the same as sys(104)
xdts=ts      ' extended text size

a$=" "       ' current text is not accessible as sysvar, so it must be erased

Rob S


Definitely a Typo (aka mistake)  - corrected and re-posted above.

The extension gaps do appear for me - if you run the macro, draw a dimension, and then look at its properties in the info box, the gap should be showing as .3 of the text size.
User since forever

Bob P

Blush...

When I installed 18.2, it reset all my file paths.  >:( 

Running the macro from the command line wasn't doing anything...

dmore

This maybe a silly question, but how do you make the "macro" work?  Can someone explain it to me like I'm a 4 year old.?  I don't what I'm supposed to do in DesignCad to use this information. ???

Quote from: prl on April 11, 2008, 06:21:31 AM
Bob P, seems to work for me.  Try using a different setting for the gptf variable in the code.  Keep in mind, Rob has all the ratios tied to the text size.



Edit - not sure if it is a typo in Rob's code or if IMSI reversed the flag condition but note the bold code.  You need to have the extfmt = 0.  I corrected the text in the below.

aptf=.8      ' arrow size factor   ***** change this line if necessary for earlier versions
gptf= 1     ' gap factor sets gap between object and extension line
extfmt=0     ' extension line fixed = 1 variable = 0 
xptf=.5      ' extension line overshoot factor   
Locn=0       ' Text location
Prcn=3       ' precision
optf=.25     ' text offset from dim line work on v 18 only
bptf=1.5     ' baseline dimline spacing on v 14 to 17 (does not work on V18.1 - bug)
at2=4        ' arrowhead type:   NOTE this is not the same as sys(104)
xdts=ts      ' extended text size

a$=" "       ' current text is not accessible as sysvar, so it must be erased

bdeck

Quote from: dmore on April 23, 2009, 09:08:25 AM
how do you make the "macro" work? 


First, in Options/Options/FileLocations find the path for "Macro"

Most users edit the path to a new folder away from the ProgramFiles folder, but that's up to you.

Download the file and put it in the macro path. Make certain it has the ".d3m"  extension.

Now you can run the macro in any of 3 ways.

   1) Press the spacebar, type the name of the macro, then hit return.
      Note: this function will first look for a command by that name, then a macro, then an executable. It will run whichever it finds first. Very cool. Be careful with names.
   2) Use Tools/MacroExecute, or "%" to bring up a macro file selector.
   3) Under Options/Options/Keybard create a keyboard shortcut for the macro.

BD

PS:

Macro files are simple text files that can be edited with a text editor. To use the info you quoted, just cut and paste it into the original macro posted by RobS. (Again, after saving, make certain the file has the correct extension)

For info on programming macros look here:

http://forum.designcad.com/index.php?topic=1537.0


Dempsey

And one more option. I have about 9 macros that I use often. I put them in a custom menu with an appropriate icon. If you need more info how to do that then let me know and I will gladly give detailed instructions.
Dempsey

Rob S


In case the question above relates to the use of the parameters, you can see that I use a default arrow size factor of .8, which means that if you use a text size of 1, all of the different arrowheads will be set to a size of.8

If you like your arrowheads to be the same as text size, just open the macro in a text editor (notepad will do), change that figure of .8 to 1, and resave the macro.

Similarly for text gap, overshoot, and extension gap. 

Not all of the parameters are actually used in the current version of the macro, you will see further down that some items are commented out.  If you want the macro to reset those option every time, you can remove those comments.

If you would like the macro to do something specific it does not do now, let us know, we might be able to customize, or tell you how.
User since forever

gellfex

Any chance this issue has been addressed in v21? I'm in v18 and can't seem to get the macro to work.

Rob S

V20 and V21 now have an option to adjust most or all dimension parameters proportionally with a change in dimension text size, turned on by default.

What this does not do is provide a common setting for dimension format, and it does not set the arrowhead size for notation arrows, match with regular test, and it also does not adjust settings where some have gotten out of whack with others.

These, the macro does do.

You should be able to run the macro easily enough in V18, just place it in your macros folder, and then from the menu, tools, macro execute, find it, and enter.

What is not working for you?
User since forever

gellfex

Thanks Rob.  Dss04 when I run it doesn't let me dimension, the dims diolog opens, but it won't let me set a point, 2 right clicks and the macro closes. Dss05 won't run at all. When I run it and enter the 2 parameters, I get a error tone and the TOOLS drop down indicates no macro running.  The macro path is correct. I don't really know what else is wrong since I don't use macros.


Quote from: Rob S on May 18, 2011, 11:35:05 AM
V20 and V21 now have an option to adjust most or all dimension parameters proportionally with a change in dimension text size, turned on by default.

What this does not do is provide a common setting for dimension format, and it does not set the arrowhead size for notation arrows, match with regular test, and it also does not adjust settings where some have gotten out of whack with others.

These, the macro does do.

You should be able to run the macro easily enough in V18, just place it in your macros folder, and then from the menu, tools, macro execute, find it, and enter.

What is not working for you?

Rob S

Anyone have V18 to test with?  Mine runs fine on V17, and V19-21, I have deleted V18.
User since forever