Dimension Measure to ATT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, I have a pretty interesting Lisp that extracts the value from a DIM and inserts it into text or Mtext as a field.
But now I want to insert it into an ATT of any block.
Can anyone help me with this?
Thank you very much.
I have attached the code.
Best regards.
;; ObjectID - Lee Mac
;; Returns a string containing the ObjectID of a supplied VLA-Object
;; Compatible with 32-bit & 64-bit systems
(defun LM:objectid ( obj )
(eval
(list 'defun 'LM:objectid '( obj )
(if (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*")
(if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring)
(list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false)
'(LM:ename->objectid (vlax-vla-object->ename obj))
)
'(itoa (vla-get-objectid obj))
)
)
)
(LM:objectid obj)
)
;; Active Document - Lee Mac
;; Returns the VLA Active Document Object
(defun LM:acdoc nil
(eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
(LM:acdoc)
)
(defun c:dimF (/ ent dtxt)
(vl-load-com)
(and (setq ent (car (entsel "\nSelect Dimension: ")))
(eq "DIMENSION" (cdr (assoc 0 (entget ent))))
(setq dtxt (car (entsel "\nSelect Destination: ")))
(wcmatch (cdr (assoc 0 (entget dtxt))) "*TEXT,MULTI*")
(vla-put-TextString
(vlax-ename->vla-object dtxt)
(strcat
"%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid (vlax-ename->vla-object ent)) ">%).Measurement \\f \"%lu2%pr2\">%")))
(princ))