(defun c:trimpoint()
(setq obje(entsel "\nLütfen bir blok seçin"))
(setq tur (cdr(assoc 0 (entget (car obje)))))
(setq oldcmdecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(while (/= tur "INSERT")
(setq obje(entsel "\nLütfen geçerli bir blok seçin"))
(setq tur (cdr(assoc 0 (entget (car obje)))))
)
(setq blockname (cdr (assoc 2 (entget(car obje)))))
(setq entlist(get-block-entities blockname))
(foreach ent entlist
(setq entvla (vlax-ename->vla-object ent))
(setq layer (vlax-get-property entvla 'Layer))
(if (= "Trimpoint" layer)
(progn
(setq noktalar (poly-pts ent))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This Code gives the points but another block with the same name, the points are same again. Because selected polyline entity name is same in every block with the same name.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ noktalar)
)
)
)
)
;;; Selection Set => ordered list of entities
(defun STD-SSLIST (ss / n lst)
;|#+ STANDALONE nil END #+ STANDALONE|;
;|#- STANDALONE|;
(if (eq 'PICKSET (type ss))
(repeat (setq n (fix (sslength ss))) ; fixed
(setq lst (cons (ssname ss (setq n (1- n))) lst))))
;|END #- STANDALONE|;
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun get-block-entities ( blk / ent lst )
;; Define the function, declare local variables
(if ;; If the following returns a non-nil value
;; i.e. if the block exists in the drawing
(setq ent (tblobjname "block" blk)) ;; get the BLOCK entity
(while (setq ent (entnext ent))
;; Step through the entities in the block definition
(setq lst (cons ent lst))
;; Construct a list of the block components
) ;; end WHILE
) ;; end IF
(reverse lst) ;; Return the list
) ;; end DEFUN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Poly-Pts (gile) (X-Y Modified)
;;; Returns the vertices list of any type of polyline (WCS coordinates)
;;;
;;; Argument
;;; pl : a polyline (ename or vla-object)
(defun Poly-Pts (pl / pa pt lst)
(vl-load-com)
(setq pa (if (vlax-curve-IsClosed pl)
(vlax-curve-getEndParam pl)
(+ (vlax-curve-getEndParam pl) 1)
)
)
(while (setq pt (vlax-curve-getPointAtParam pl (setq pa (- pa 1))))
(setq pt (list (car pt) (cadr pt)))
(setq lst (cons pt lst))
)
)