Search Text String

Search Text String

SilentStrike24
Enthusiast Enthusiast
398 Views
2 Replies
Message 1 of 3

Search Text String

SilentStrike24
Enthusiast
Enthusiast

Hi guys!

 

Please help me with a small issue.

 

Is there any free routine that can search a text string in a drawing and then add it in a formula? String is "TOTAL LENGTH:XXX" (XXX is variable) and i need to set dimension text height = XXX value * 0.4

I already set the dimension variables, only text/arrows height needs to be calculated. (see below code)

 

Thanks in advance!

 

(defun c:dsq()(command "dimclrt" "7" "" )(command "dimasz" "1" "" )(command "dimtxt" "1" "" )(command "dimclrd" "1" "" )(command "dimclre" "1" "" )(command "dimscale" "1" "" )(command "dimdec" "0" "" )(command "dimtvp" "0.7" "" )(command "dimtih" "OFF" "" )(command "dimtoh" "OFF" "" )(command "dimexo" "0" "" )(command "dimexe" "0.8" "" )(command "dimcen" "2" "" )(command "dimtofl" "ON" "" )(command "dimtfill" "0" "" )(princ))

0 Likes
399 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant

[Same question as >here<.  Are you the same person with more than one User ID?  This is the better Forum for it, anyway.]

 

If it's really always exactly as described, then in simplest terms, something like:

 

(setq

  txt (car (entsel "\nSelect TOTAL LENGTH Text object: "))

  yourTextArrowsHeight (* (atof (vl-string-subst "" "TOTAL LENGTH:" (getpropertyvalue txt "TextString"))) 0.4)

); setq

Kent Cooper, AIA
Message 3 of 3

SilentStrike24
Enthusiast
Enthusiast

Thanks @Kent1Cooper !

 

Yes, it is me, twice😁 it was not my intention anyway, first ID was made with an old e-mail address and i forgot the password😁

 

Thanks for the hint, i'll give it a try!