Jump to content

DIMSTYLE change doesn't correctly change everything


ElAmigo

Recommended Posts

Hello friends, I have the follow piece of code:

(while (< i (sslength selectie))
    (setq ent (ssname selectie i)) ; Takes every entity out of the selection
    (setq data (entget ent))
    (if (= (cdr (assoc 0 data)) "DIMENSION") ; Checks if it is a dimension
      (progn
        (setq newData (subst (cons 3 DimStyleOverride2) (assoc 3 data) data)) ; Changes DIMSTYLE to variable DimStyleOverride2
        (entmod newData)
        (entupd ent)
      )
    )
    (setq i (+ i 1))
  )

"selectie" is a selection made beforehand in the code. This code changes the dimstyle to a variable set beforehand. This code is part of an upscaling tool. The problem is, it does update the dimstyle but doesn't show it. Text height is not correct and the measurements don't update correctly. When I manually change the dimstyle and change it back to this variable it does show every change that has to be made. Regen doesn't work either. I hope someone knows an answer to this problem

Link to comment
Share on other sites

Run your Lisp and do a REGEN by hand. If it works, include REGEN in the program.

Link to comment
Share on other sites

Posted (edited)
51 minutes ago, fuccaro said:

Run your Lisp and do a REGEN by hand. If it works, include REGEN in the program.

REGEN didn't work. But I luckily did find a different solution using the following commands:

        (command "_.-DIMSTYLE" "_R" DimStyleOverride2 "") ;; Sets current dimstyle
        (command "_-DIMSTYLE" "_A" ent "") ;; Apllies current dimstyles to selected entities

 

Edited by ElAmigo
Link to comment
Share on other sites

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