Jump to content

removeAEC.LSP and UNITS change problem


ibach

Recommended Posts

after using the following lsp dwg units revert to the value from the time the dwg was created even though the -dwgunits was set to new value before.

How to avoid that?

 

 

if dwg was created in inches, changed to cm using -dwgunits

 

it will change back to inches after the frollowing code on autocad 2018 and 2019... here is the code:

 

 

 

(defun gc:GetDictEntries (dict / result)
(and (= (type dict) 'ENAME) (setq dict (entget dict)))
(while
(setq dict (vl-member-if (function (lambda (x) (= (car x) 3))) (cdr dict)))
(setq result (cons (cons (cdar dict) (cdadr dict)) result))
)
(reverse result)
)

;; delete all AEC*
(defun c:removeAEC ()
(foreach dict (gc:GetDictEntries (namedobjdict))
(if (wcmatch (car dict) "*AEC*")
(foreach entry (gc:GetDictEntries (cdr dict))
(entdel (cdr entry))
)
(entdel (cdr dict))
);fin if
)
(princ)
);fin defun

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