If the block is not scaled other than 1.0 to 1.0 and it has a normal of '(0.0 0.0 1.0)
You can transform two points in the block object.
You cannot get a selection set in a block definition though.
P=
Code:
;___________________________________________________________________________________________________________
;
; Function for Translating coordinates around the origin using a rotation angle in radians
; and returns the rotated point.
;___________________________________________________________________________________________________________
(defun TransformPoint (lstPoint sngTheta)
(list
(+ (* (nth 0 lstPoint) (cos sngTheta))
(* (nth 1 lstPoint) -1 (sin sngTheta))
)
(+ (* (nth 0 lstPoint) (sin sngTheta))
(* (nth 1 lstPoint) (cos sngTheta))
)
(nth 2 lstPoint)
)
)
;___________________________________________________________________________________________________________
;
; Translates coordinates from the world coordinate system to the blocks coordinate system
;___________________________________________________________________________________________________________
(defun TranslateWorldToBlock (objBlock ; Block object
lstPointInWorld ; Point in World Coordinate system
/
lstPointInBlock ; Coordinates of point (RELATIVE TO BASE POINT)
; inside the block
objDocument ;
varReturn ; Variant return of translate coordinates
)
(if (and
(setq objDocument (vla-get-document objBlock))
(setq lstPointInWorld (mapcar '- lstPointInWorld (vlax-get objBlock "insertionpoint")))
(setq varReturn (vla-translateCoordinates (vla-get-utility objDocument)
(vlax-3d-point lstPointInWorld)
acUCS
acOCS
:vlax-false
(vla-get-normal objBlock)))
(setq lstPointInBlock (vlax-safearray->list (variant-value varReturn)))
(setq lstPointInBlock (transformpoint lstPointInBlock (* -1 (vla-get-rotation objBlock))))
)
lstPointInBlock
)
)