- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a routine that I have been working on (cobbled together from various sources...) and have been getting this error "error: bad argument type: lselsetp nil" for the functions that have no objects in their selection set.
I am fairly new to lisp, what would be the best way to check if there are any objects in the selection set and if not end the function?
Regards.
Ross.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Set elevations to 2 Decimal Places via Change in Point Label Style (EX_INVERT)
;---------------------------------
(vl-load-com)
(defun c:2DINV ( / Cpnt)
(SETQ CadApp (VLAX-GET-ACAD-OBJECT));Get AutoCAD Object
(setq C3dApp (vla-getinterfaceobject CadApp "AeccXUiLand.AeccApplication.11.0"));2017 C3D
(setq C3Ddoc (vla-get-activedocument C3dApp));Get Active Document
(setq ptlblstyles (vlax-get C3Ddoc 'pointlabelstyles));Get Point Styles
(setq style1 (vlax-get-property ptlblstyles 'item "ONK_(Elev) ONLY (INV) (2DP)"));get the Point Style
(mapcar 'vlax-release-object (list C3Ddoc C3dApp CadApp));release objects
;Select Points
(setq Slcsct (ssget "X" '((0 . "AECC_COGO_POINT")(8 . "EX_INVERT"))))
;Selection Length
(setq SlcLen (sslength Slcsct))
;Counter
(setq tn 0)
(repeat SlcLen
(setq tmpname (ssname Slcsct tn))
(setq Cpnt (vlax-ename->vla-object tmpname))
(vlax-put-property Cpnt 'LabelStyle style1 )
(setq tn ( + tn 1))
);repeat
);defun
(princ)
Solved! Go to Solution.