Originally Posted by
aaron.bentley
fixo, Here is the title blocks I'm trying to fill in. The Dialog box shows which values I need to stay the same between drawings. Thanks for your help. Aaron
Hi again
Try this one
Code:
(defun C:tit (/ dcl_id)
(setq dcl_id (load_dialog "1.dcl"))
(if (not (new_dialog "title" dcl_id))
(exit))
(action_tile "revison" "(setq revno $value)")
(action_tile "Job Number" "(setq jobno $value)")
(action_tile "by" "(setq by $value)")
(action_tile "Date" "(setq dat $value)")
;;; (action_tile "order" "(setq ord $value)");<-- not used in this block
(action_tile "Description" "(setq desc $value)")
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
)
(action_tile
"accept"
"(done_dialog)(setq userclick T))"
)
(setq check (start_dialog))
(unload_dialog dcl_id)
(if userclick
(progn
(vl-load-com)
(or adoc
(setq adoc
(vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(vlax-for layout (vla-get-layouts adoc)
(vlax-for obj (vla-get-block layout)
(if (and
(eq "AcDbBlockReference" (vla-get-objectname obj))
(eq "STATUS" (vla-get-name obj)))
(progn
(setq atts (vlax-invoke obj 'GetAttributes))
(foreach at atts
(cond
((eq "REVISION" (strcat (vla-get-tagstring at)))
(vla-put-textstring at revno))
((eq "JOB_NUMBER1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at jobno))
((eq "DRAFTER1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at by))
((eq "DATE2" (strcat (vla-get-tagstring at)))
(vla-put-textstring at dat))
((eq "DESCRIPTION1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at desc))
(T nil)))))))))
(vla-regen adoc acallviewports)
(princ)
)
~'J'~