Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/08/2021 in all areas

  1. That syntax : (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) is general approach of retrieving enames from sel. set obtained by using any (ssget) method... It is often used when you don't want to iterate through sel. set and form entity list by using (ssname) function... (ssname) approach is better, because it's faster than (ssnamex), but anyway those differences are measured in few milliseconds ranges... Common thing is that you use (ssnamex) when you want to make code concise and quickly get resulting ename list... First part (vl-remove-if 'lisp ... ) is used just in situations where beside enames in list (mapcar 'cadr (ssnamex ss)) there are other elements that are actually lists - (mapcar 'cadr (ssnamex ss)) = (ename1 ename2 (list1) (list2) ... )... (vl-remove-if 'listp ... ) ensures that resulting output of complete syntax is list of only enames... Now I forgot an example, so I may be wrong, but (setq ss (ssget "_X")) and then (mapcar 'cadr (ssnamex ss)) will produce list that beside enames has also other not relevant lists as elements... So in any situation (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) is more reliable approach than just (mapcar 'cadr (ssnamex ss)), but some users still are using shorter (mapcar 'cadr (ssnamex ss)) as they are sure that (ssnamex ss) don't give side lists within output resulting list - i.e. (setq ss (ssget "_X")) wasn't used for storing ss variable for later usage in (ssnamex ss)... [EDIT] Just checked : (setq ss (ssget "_X")) (setq elst (mapcar 'cadr (ssnamex ss))) [elst contains only enames] Then : (setq ss (ssget)) ;selected couple of lines, lwpolylines... (setq elst (mapcar 'cadr (ssnamex ss))) [elst contains enames + one list at the end] Conclustion : (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) should be used if (setq ss (ssget "_X")) wasn't used - i.e. for other methods... So I did forget, but anyway main story stands : (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) is choice with which you'll get enames list in any situation... [/EDIT]
    1 point
  2. this will allow you to select inside your polyline then delete stuff thats still within the min max of the polyline not completely inside. ;;----------------------------------------------------------------------------;; ;; ssget "WP" doesn't work well with arc this fixes it (defun SELECTINSIDE (ent acc / i j l) (setq i (/ (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)) acc) j (- i) ) (repeat (fix acc) (setq l (cons (trans (vlax-curve-getpointatdist ent (setq j (+ j i))) 0 1) l)) ) (setq SS1 (ssget "_WP" l)) ) (SELECTINSIDE poly 100) (setq SS (ssget "_W" minExt maxExt)) (ssdel poly ss) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1))) (ssdel e SS) ) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (entdel e) )
    1 point
  3. 1) Turn the Viewport into a block 2) Scale the block 3) Explode the block
    1 point
×
×
  • Create New...