width factor attribute of multi drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all my friends
thanks for your sharing me
I have lisp file that changed attrbuite width factor ,but into only one file (who it open ) if there is a way to change the width factor to changer all drawing into specifed foder . the following one the lisp which's i need to revised to be able modify mult drawing
(defun c:widedit (/ aDoc x attent uwd option tag blk bn)
;;; pBe 11JN2013 ;;;
(vl-load-com)
(setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(if (and (setq x (car (nentsel "\nSelect attribute: ")))
(eq "ATTRIB" (cdr (assoc 0 (entget x))))
(setq attent (vlax-ename->vla-object x))
(princ (strcat "\nCurrent Width is <" (rtos (vla-get-scalefactor attent) 2)"> "))
(setq uwd (getreal "\nEnter new width: ")))
(progn
(initget "Y N")
(setq option (cond
((getkword "\nApply width to all Attribute of the same block? [Yes/no] <N>: "))
( "N" )))
(if (eq option "N")
(vla-put-scalefactor attent uwd)
(progn
(setq tag (vla-get-tagstring attent))
(setq Blk (vla-ObjectIdToObject aDoc
(vla-get-OwnerId attent))
Bn (vla-get-effectivename blk))
(vlax-for itm (vla-item (vla-get-blocks aDoc) bn)
(if (and (eq (vla-get-objectname itm) "AcDbAttributeDefinition")
(eq (vla-get-tagstring itm) tag))
(vla-put-scalefactor itm uwd)))
(vlax-for layout (vla-get-layouts aDoc)
(vlax-for i (vla-get-block layout)
(if (and
(eq (vla-get-objectname i) "AcDbBlockReference")
(eq (Vla-get-hasAttributes i) :Vlax-true)
(eq (vla-get-effectivename i) bn)
)
(foreach itm (vlax-invoke i 'GetAttributes)
(if (eq (vla-get-tagstring itm) tag)
(vla-put-scalefactor itm uwd))
)
)
)
)
)
)
)
(vl-some
'(lambda (j) (if (null (eval (car j))) (princ (cadr j))
))
'((x "\n<<None Selected>>")
(attent "\n<<Selected object not an Attribute>>")
(uwd "\n<<No Width value>>"))
)
)
(princ)
)