Jump to content

Recommended Posts

Posted

Hello, 

 

Is possible for someone to help me with a lisp that allows to match measurement of a dimension/rotated dimension (with Format:decimal and Precision: 0.0) to a field?

 

Or add it to the lisp bellow with "name"  dff   ?

(defun C:fff (/ fStr cObj vObj cTxt vTxt)
  (vl-load-com)
  (if
    (and
      (setq cObj (nentsel "\n  Select source Text, MText or Attribute field to match: "))
      (vlax-property-available-p (setq vObj (vlax-ename->vla-object (car cObj))) 'TextString)
    );and
    (if
      (and
        (setq cTxt (nentsel "\n  Select destination Text, MText or Attribute to insert field: "))
        (vlax-property-available-p (setq vTxt (vlax-ename->vla-object (car cTxt))) 'TextString)
      );and
      (vla-put-TextString vTxt (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-ObjectID vObj)) ">%).TextString>%"))
;;;"%<\\AcObjProp Object(%<\\_ObjId 2022864408>%).TextString)>%" 
    
    );if
  );if
  (princ)
);fff

(defun c:arf(/ fStr cObj vObj cTxt vTxt)
  
  (vl-load-com)
  
  (if
    (and
      (setq cObj(entsel "\nPick object with Area property > "))
      (vlax-property-available-p
	(setq vObj(vlax-ename->vla-object(car cObj))) 'Area)
      ); end and
    (if
      (and
	(setq cTxt(nentsel "\nPick Text, MText or Attribute to insert field > "))
	(vlax-property-available-p
	  (setq vTxt(vlax-ename->vla-object(car cTxt))) 'TextString)
	); end and
      (progn
      (vla-put-TextString vTxt
	(strcat "%<\\AcObjProp Object(%<\\_ObjId "
		(itoa(vla-get-ObjectID vObj)) ">%).Area>%"))
       ); end progn
      ); end if
    ); end if
  (princ)
  ); end of c:arfield

 Thank you in advance!

Posted (edited)

Look at this %<\AcObjProp Object(%<\_ObjId 1704373728>%).Measurement \f "%lu2%pr0">% so measurement is what your after for a dimension ?

 

Edited by BIGAL
Posted (edited)
6 hours ago, BIGAL said:

Look at this %<\AcObjProp Object(%<\_ObjId 1704373728>%).Measurement \f "%lu2%pr0">% so measurement is what your after for a dimension ?

 

i think yes +/-.... field expression i get is       %<\AcObjProp Object(%<\_ObjId 1732673749648>%).Measurement \f "%lu2%pr1">%         , what i need the lisp does only partially.... with fff command, i can match texts for name of elements, dimensions, but for lenght of element, command fff takes the Mtext propriety of the dimension, and when dimension changes, text does not and turns into ####. 

SO i was wondering if possible to have a lisp that saves me some time not to do manually each time. 

Example of using the lisp:

example.thumb.png.f9c22dc1c9700e7ea0b4653fb3476adb.png

Edited by socacidan
Posted

You need to look at the object selected then run a sequence that matches. Use a Cond.

 

I would use a ssget with filters then it can only be a dimension,text,mtext, then use (ssname ss 0) so it gets 1st item, then look at what it is, a text etc has a Textstring even if its got nothing in the string. Hard to see. The dims can have various types like an angle still has Measurement (RO) = 1.5707963267949 ie 90 deg. Dim an arc ArcLength (RO) = 9786.391

 

The dimensions have a sub class which is the style of the dimension ObjectName (RO) = "AcDbArcDimension", ObjectName (RO) = "AcDbAlignedDimension"

 

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