issammesk Posted May 10, 2018 Posted May 10, 2018 hi all please if you can help me i have polyline as rectangle with area 9000 and i have more 1800 from this obect i need lsp to make each on of them as block beause later i want to dataextraction these block to excel Quote
BIGAL Posted May 10, 2018 Posted May 10, 2018 The tools to do this are simple find a pline co-ords program, see below. For a simple step others will code later make 1 object into block make sure you have correct insertion point. Using a ssget pick all plines use a Repeat look at each pline and get the 1st co-ord X Y this matches the block insert point. Then just insert your block, I would suggest a different layer. ; pline co-ords example ; By Alan H (defun getcoords (ent) (vlax-safearray->list (vlax-variant-value (vlax-get-property obj "Coordinates" ) ) ) ) ; program starts here (defun c:AHPL-BLK ( / ss x co-ords co-ords2xy) (setq ss (ssget (list (cons 0 "Lwpolyline")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq co-ords (getcoords obj)) (setq pt (list (nth 0 co-ords) (nth 1 co-ords))) (command "-insert" "yourblockname" pt 1 1 0) ) ) Quote
SLW210 Posted May 10, 2018 Posted May 10, 2018 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.