EIA Posted Wednesday at 01:32 PM Posted Wednesday at 01:32 PM So right now in my company we all use the same linetype scale, which depends on our dimstyle; say, for example, we have 3 dimstyles, named "1", "2" & "3": I want the linetype scale to change to the number in the name of the dimstyle. My biggest concern with this, is it possible to execute a routine everytime the dimstyle is changed, or are they only executed with commands? Quote
GLAVCVS Posted Wednesday at 02:02 PM Posted Wednesday at 02:02 PM Hi @EIA If everyone in your company uses AutoCAD LT, it's going to be difficult for you to achieve that. Quote
EIA Posted Wednesday at 02:07 PM Author Posted Wednesday at 02:07 PM Yeah everyone here uses LT, I am asking as last resource but my guess is that it's just impossible to do this. Out of curiosity though, is there a way to do this in the full version of AutoCAD? Quote
GLAVCVS Posted Wednesday at 02:42 PM Posted Wednesday at 02:42 PM In AutoCAD, theoretically, yes. Save this code to a file and name it with the lsp extension. Type 'appload' in the command line, search for, select the file you created, and press the 'Load' button. After that, the file will be loaded. Then, modify DIMSTYLE from the command line: if you get a message... WIN! (if (not GL*react*) (setq GL*react* (vlr-sysvar-reactor nil '((:vlr-sysVarChanged . aviso)))) ) (defun aviso (e p / r) (if (eq (car p) "DIMSCALE") (alert (vl-list->string (reverse '(33 33 78 65 67 32 117 111 89 10 33 33 115 110 111 105 116 97 108 117 116 97 114 103 110 111 67)) ) ) ) ) 1 Quote
Steven P Posted Wednesday at 03:01 PM Posted Wednesday at 03:01 PM Not sure if reactors are in LT Quote
BIGAL Posted Wednesday at 11:22 PM Posted Wednesday at 11:22 PM You may need to make some keyboard shortcuts in lisp and load these on start up. I have a lisp that contains many defuns and its loaded on startup, Appload "Startup suite" (defun c:D1 ( / )(setvar 'ltscale 1.0)(setvar 'dimstyle "1")) Quote
Tomislav Posted Thursday at 10:34 AM Posted Thursday at 10:34 AM (edited) or u could make three new commands (like dim1,dim2 and dim3) in which u can set dim style and linetype at once with macro (although I don't know is that possible in LT) I use this for loading linetypes from different files at once: ^C^C-LINETYPE;L;*.*;"C:/acad_linije/TOMI 1000.lin";; ^C^C-LINETYPE;L;*.*;"C:/Users/tvargek/AppData/Roaming/Autodesk/AutoCAD Electrical 2020/R23.1/enu/Support/acadiso.lin";; Edited Thursday at 10:38 AM by Tomislav Quote
EIA Posted Thursday at 01:06 PM Author Posted Thursday at 01:06 PM On 3/26/2025 at 2:42 PM, GLAVCVS said: In AutoCAD, theoretically, yes. Save this code to a file and name it with the lsp extension. Type 'appload' in the command line, search for, select the file you created, and press the 'Load' button. After that, the file will be loaded. Then, modify DIMSTYLE from the command line: if you get a message... WIN! (if (not GL*react*) (setq GL*react* (vlr-sysvar-reactor nil '((:vlr-sysVarChanged . aviso)))) ) (defun aviso (e p / r) (if (eq (car p) "DIMSCALE") (alert (vl-list->string (reverse '(33 33 78 65 67 32 117 111 89 10 33 33 115 110 111 105 116 97 108 117 116 97 114 103 110 111 67)) ) ) ) ) Expand This worked actually, thank you so much! The lisp itself kinda confuses me a bit (I can't even see where you tell it to check for the dimstyle), but that should be just a bit of reverse engineering, it is awesome to see that it is actually manageable. Thanks to everyone else as well, making a command for it was my first approach to this, and it is what we have right now, it doesn't really give me any problem but people here prefer to change the style on the top bar instead of with a command (eugh) so I was stuck here trying to solve this. Quote
Tomislav Posted Thursday at 01:25 PM Posted Thursday at 01:25 PM On 3/27/2025 at 1:06 PM, EIA said: it doesn't really give me any problem but people here prefer to change the style on the top bar instead of with a command (eugh) so I was stuck here trying to solve this. Expand you can create an icon for it and drag it on toolbar of your preference (that's actually what I do, I have 'My toolbar' with like 10 custom commands) so it's easily accessible... Quote
EIA Posted Thursday at 01:40 PM Author Posted Thursday at 01:40 PM I know, the thing is I will have a button that calls the command instead of a list with the styles. And yeah, all of this is just small details but still I wanted to see if I could fix it. Quote
GLAVCVS Posted Thursday at 02:01 PM Posted Thursday at 02:01 PM On 3/27/2025 at 1:06 PM, EIA said: This worked actually, thank you so much! The lisp itself kinda confuses me a bit (I can't even see where you tell it to check for the dimstyle), but that should be just a bit of reverse engineering, it is awesome to see that it is actually manageable. Thanks to everyone else as well, making a command for it was my first approach to this, and it is what we have right now, it doesn't really give me any problem but people here prefer to change the style on the top bar instead of with a command (eugh) so I was stuck here trying to solve this. Expand Fenomenal Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.