Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using this code and I want to entget each object. I keep getting the error for lines. and will not proceed afetr this error
** Error: bad argument type: lentityp #<VLA-OBJECT IAcadLine 000001d4e8d0e388> **
Any help would be appreciated
here is the code:
(vlax-map-collection (vla-get-modelspace doc)
'(lambda (object)
(cond ((= "AcDbBlockReference" (vla-get-objectname object))) (princ))
(cond ((= "AcDbMText" (vla-get-objectname object)) (princ)))
(cond ((= "AcDbHatch" (vla-get-objectname object)) (princ)))
(cond ((= "AcDbLine" (vla-get-objectname object))
(progn
(setq entg (entget (vlax-Ename->Vla-Object object)))
(setq start (cdr (assoc 10 entg)))
(setq end (list (nth 0 start) (nth 1 start) 0 ))
(vla-move object (vlax-3d-point start)(vlax-3d-point end))
)
))
(cond ((= "AcDbPolyline" (vla-get-objectname object))
(progn
(setq entg (entget (vlax-Ename->Vla-Object object)))
(setq start (cdr (assoc 10 entg)))
(setq end (list (nth 0 start) (nth 1 start) 0 ))
(vla-move object (vlax-3d-point start)(vlax-3d-point end))
)
))
)
)
Solved! Go to Solution.