EIA Posted March 26 Posted March 26 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 March 26 Posted March 26 Hi @EIA If everyone in your company uses AutoCAD LT, it's going to be difficult for you to achieve that. Quote
EIA Posted March 26 Author Posted March 26 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 March 26 Posted March 26 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
BIGAL Posted March 26 Posted March 26 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 March 27 Posted March 27 (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 March 27 by Tomislav Quote
EIA Posted March 27 Author Posted March 27 22 hours ago, 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)) ) ) ) ) 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 March 27 Posted March 27 14 minutes ago, 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. 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 March 27 Author Posted March 27 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 March 27 Posted March 27 51 minutes ago, 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. 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.