Lisp required - Dimension values to Excel OR in word / CAD

Lisp required - Dimension values to Excel OR in word / CAD

designdistrict7
Advocate Advocate
1,542 Views
5 Replies
Message 1 of 6

Lisp required - Dimension values to Excel OR in word / CAD

designdistrict7
Advocate
Advocate

Hello Experts,

I need a LISP program that can make a list Dimension values of selected dimension to a excel file or in CAD its self. and it will come in same order of selection.  Can any one help me ? 

0 Likes
1,543 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant

As always, start with giving example dwg.

The most simple would be an MTEXT, one line, one value.

0 Likes
Message 3 of 6

designdistrict7
Advocate
Advocate

Hi,

As shown in below image i need those dimension value to a an excel sheet or in cad as a list, in image I am showing some demension and selection number ( how i am picking each dimension) and output need to get as shown  in excel sheet. 

dim.PNG

0 Likes
Message 4 of 6

vladimir_michl
Advisor
Advisor

The Text2XLS command in the Click2XLS LISP app (freeware) does exactly that...

See https://www.cadforum.cz/cadforum_en/export-text-from-dwg-drawings-to-excel-tip9814

 

Vladimir Michl, www.cadstudio.cz - www.cadforum.cz

 

Message 5 of 6

Sea-Haven
Mentor
Mentor

If you just want the dims in size order no need to pick in order rather select as many as wanted make a list then vl-sort the list, then make a csv or export direct to excel. A pretty straight forward request. 

 

; a simple example
(defun c:test ( / ss lst val)
(setq ss (ssget (list (cons 0 "Dimension"))))
(setq lst '())
(repeat (setq x (sslength ss))
(setq val (cdr (assoc 42 (entget (ssname ss (setq x (- x 1)))))))
(setq lst (cons val lst))
)
(setq lst (vl-sort lst (function (lambda (a b) (< a b)))))
(princ lst)
(princ)
)
0 Likes
Message 6 of 6

john.uhden
Mentor
Mentor

If you've been here before, you might know that I despise the "needy" approach as though this place were a freeware drive-through.  But I am impressed with your audacity... "Lisp required."  Is this requirement imposed by a world leader perhaps?  If so, who?  I suffer from a certain degree of discrimination, for example against 'Rocket Boy.'

John F. Uhden

0 Likes