Dimensions to Excel Lsip questions

Dimensions to Excel Lsip questions

XlhHarley
Advocate Advocate
1,039 Views
2 Replies
Message 1 of 3

Dimensions to Excel Lsip questions

XlhHarley
Advocate
Advocate

Hello:

 

I have a lisp that generates the dimensions to excel, but I need the text over ride to travel with it  ie: <> x 6'   

 

Could somebody/anybody supply a hint on how that would/could work.

 

thanks for you help

 

 

 

0 Likes
Accepted solutions (2)
1,040 Views
2 Replies
Replies (2)
Message 2 of 3

CodeDing
Advisor
Advisor
Accepted solution

Harley,

 

Try something like this! Hope it helps. Best,

~DD

 

(defun c:EZDIM (/ UserEnt DimTxt)

(setq UserEnt (entsel "\nSelect Dimension: "))
(setq DimTxt  (cdr (assoc 1 (entget (car UserEnt)))));assoc 1 is primary text DXF code
(princ (strcat "\n" DimTxt))
(princ)
  
);defun
0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

@XlhHarley wrote:

... 

I have a lisp that generates the dimensions to excel, but I need the text over ride to travel with it  ie: <> x 6'

 

Could somebody/anybody supply a hint on how that would/could work.

.... 


I assume that when there is no  text override, your routine generates text equivalents  of the measured distances to send to Excel, and that if the text override is as above, you don't  want the "<>" part sent out, but rather the text equivalent  of it substituted.  If those are valid assumptions, try this, with 'ddata' being the dimension's entity-data list:

 

(if (= (setq meas (cdr (assoc 1 ddata))) ""); no override content?
  (rtos (cdr (assoc 42 ddata))); then -- text equivalent of distance [in current mode & precision settings] 
(vl-string-subst (rtos (cdr (assoc 42 ddata))) "<>" meas)
; else -- replace "<>" in override with text equivalent of distance
); if

If won't matter if the text override does not  contain <> for the actual measurement.

 

ONLY for linear -measurement Dimensions, not angular ones -- that could also be accommodated with additional code.

Kent Cooper, AIA
0 Likes