Jump to content

Recommended Posts

Posted

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

Untitled.jpg

Posted

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)
 )
)

Posted

thank you sir for your help

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...