Jump to content

Recommended Posts

Posted

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?

Posted

Hi @EIA


If everyone in your company uses AutoCAD LT, it's going to be difficult for you to achieve that.

Posted

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?

Posted

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))
	   )
    )
  )
)

 

  • Like 1
Posted

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"))

 

Posted (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 by Tomislav
Posted
  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!

image.png.6b888c9927cf3fba64a64e4f57368acb.png

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.

Posted
  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...

 

Posted

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.

Posted
  On 3/27/2025 at 1:06 PM, EIA said:

This worked actually, thank you so much!

image.png.6b888c9927cf3fba64a64e4f57368acb.png

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 😊

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...