Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Requested for change code in lisp

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
paliwal222
374 Views, 5 Replies

Requested for change code in lisp

Dear all

a humble request for change code in lisp file

want to edit dimension in command bar by multiple selection

find a code in forum but it select one dimension at a time

i want multiple selection and edit one by one continuously

if it possible kindly provide the code please

Thanks

5 REPLIES 5
Message 2 of 6
paliwal222
in reply to: paliwal222

Solved by
Sir Kent1Cooper Thanks
(vl-load-com)
(defun c:dedit (/ seldim n dim cobj ns)
(prompt "\nTo override Dimension object(s) text content,")
(if (setq seldim (ssget ":L" '((0 . "DIMENSION"))))
(repeat (setq n (sslength seldim))
(setq
dim (ssname seldim (setq n (1- n)))
cobj (vlax-ename->vla-object dim)
); setq
(redraw dim 3); highlight
(setq ns (getstring "\nNew text content: "))
(vlax-put-property cobj 'TextOverride ns)
); repeat
); if
(princ)
)
Message 3 of 6
paliwal222
in reply to: paliwal222

problem already solved by Sir Kent1Cooper

(vl-load-com)
(defun c:dedit (/ seldim n dim cobj ns)
(prompt "\nTo override Dimension object(s) text content,")
(if (setq seldim (ssget ":L" '((0 . "DIMENSION"))))
(repeat (setq n (sslength seldim))
(setq
dim (ssname seldim (setq n (1- n)))
cobj (vlax-ename->vla-object dim)
); setq
(redraw dim 3); highlight
(setq ns (getstring "\nNew text content: "))
(vlax-put-property cobj 'TextOverride ns)
); repeat
); if
(princ)
)

Message 4 of 6
paullimapa
in reply to: paliwal222

give this a try:

; cc select & edit dimension string
; OP:
; https://forums.autodesk.com/t5/autocad-forum/requested-for-change-code-in-lisp/m-p/12304443#M1117115
(defun c:cc ( / seldim cobj ns)
 (vl-load-com)
 (princ"\nPick Dimension ")
 (if (setq seldim (ssget '((0 . "DIMENSION"))))
  (foreach b (mapcar 'cadr (ssnamex seldim))  ; create list of all entities from selection set & cycle through
   (if (= 'ename (type b)) ; confirm is entity
     (progn
      (redraw b 3)
      (setq cobj (vlax-ename->vla-object b))
      (setq ns (getstring "\nNew Dimension ? : "))
      (vlax-put-property cobj 'TextOverride ns)
      (redraw b 4)
     )
   )
  )
 )
(princ)
)

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 6
paliwal222
in reply to: paullimapa

Dear Sir paullimapa
thanks very much
it's work correctly, it is more correct then above given code. i can copy and paste value from excel
above code is some error its select reverse but your code is more correct i can select dimension by fencing and its edit by sequence.
Thanks very much again from heart
Message 6 of 6
paullimapa
in reply to: paliwal222

Glad to have helped…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report