Jump to content

help ....modify dimension style from routine lsp


Recommended Posts

Posted

hello people:

 

I want to control the size of the current dimension style from routine lsp

image.png.d9673221fb1d75eea887cad45b1f4aee.png

 

image.png.95ec1a9b5b6c589e5639acfe98d677ae.png

 

 

there is some variable that controls?

 

 

example.dwg

Posted

The dim style is held in a table, and there is a lot of variables involved in a dim so 1st step is finding which one. Which using VL is quick ScaleFactor = 4.0 

 

You could look at Dimoverride command may do what you want.

Posted (edited)

That is the Variable Value for the DIMSCALE variable, as shown in the SYSVDLG screenshot.

I don't know how to do it with lisp, I would use the Action Recorder for that.

Another way to do it would be to include it in your default Template as the Current DimStyle, then you hit the ground

running.

image.thumb.png.8de36e72c1ab7b8330279803df52179e.png

Edited by Dadgad
Alternate option
  • Agree 1
Posted (edited)

This will update the dimscale. so any dimension created after will have the new value.

optional code to save that new value to a named dimstyle and to update existing dimensions.

 

(defun c:foo (/ style SS)
  ;(setq style "Standard")    
  ;(vl-cmdf "-Dimstyle" "Restore" style)
  (if (setq x (getreal (strcat "\nSet new Dimscale <" (rtos (getvar 'DIMSCALE)2)">: ")))
    (setvar 'DIMSCALE x)
  )               
  ;(vl-cmdf "-Dimstyle" "Save" style "Y")  ;updates existing dimensions
  ;(setq ss (ssget))                       
  ;(vl-cmdf "-Dimstyle" "Apply" SS "")     ;update selected dimensions
  (princ)
)

 

Edited by mhupp

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