Not applicable
03-03-2015
06:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I've been working with something I never had to: Rectangle dimension extraction and count in drawing to table.
Since now I've been trying to handle a massive amount of drawings that need a high criteria count, my AutoCad study demand got higher.
I Have Too Many types of Rectangle.And I write pline rectangle L x H dimension and drawing count one by one in Exel.
I have Lisp But ıt Extract A rectangle Dimension and no count to table.
but I want to Extract Multiselect rectangle in drawing and extract them length x height x drawing count in to table.
I Have pline rectangle Example drawing and lisp in attachment.
Can We Change Or Rewrite LSP This Way.
Please,help me.
(defun c:recdim (/ acadobj doc len lenh modelspace mytable poly pt wid ) (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq poly (vlax-ename->vla-object (car (Entsel)))) (if (and (= (vlax-curve-getendparam poly) 4.0) (= (vla-get-closed poly) :vlax-true) (= (setq len (vlax-curve-getdistatparam poly 1)) (- (vlax-curve-getdistatparam poly 3) (vlax-curve-getdistatparam poly 2)) ) (or(= (abs(- (angle (vlax-curve-getpointatparam poly 0) (vlax-curve-getpointatparam poly 1)) (angle (vlax-curve-getpointatparam poly 1) (vlax-curve-getpointatparam poly 2)) )) (/ pi 2) ) (= (abs(- (angle (vlax-curve-getpointatparam poly 0) (vlax-curve-getpointatparam poly 1)) (angle (vlax-curve-getpointatparam poly 1) (vlax-curve-getpointatparam poly 2)) )) (* 3(/ pi 2)) ) ) ) (progn (setq wid (- (vlax-curve-getdistatparam poly 2) (vlax-curve-getdistatparam poly 1))) (if (< len wid) (setq lenh len len wid wid lenh) ) (setq pt (vlax-3d-point (getpoint "\n table insert point:"))) (setq modelSpace (vla-get-ModelSpace doc)) (setq MyTable (vla-Addtable modelSpace pt 3 2 10 40)) (vla-SetCellValue MyTable 0 0 "Rectangle dimensions") (vla-SetCellValue MyTable 1 0 "Length") (vla-SetCellValue MyTable 1 1 (rtos len 2 3)) (vla-SetCellValue MyTable 2 0 "Width") (vla-SetCellValue MyTable 2 1 (rtos wid 2 3)) ) (princ "\nSelected object is not rectangle.") ) )
Solved! Go to Solution.
Link copied