Jump to content

BLOCK ATTRIBUTE to POLYLINE OBJECT DATA


Lee94

Recommended Posts

Hello,

 

I want to be able to Explode (or BURST) the Block.

 

And for the Block Attribute 'CAB_ID' to copy through to the Object Data Field 'CAB_ID' on the Polyline.

 

I used a program called POWER MAP, which was alright but still long winded, and a program called GeoTools, which is very powerful, but not quite what is needed.

 

Im sure this would be relatively simple for a Pro user.

 

Any help much appreciated.

BLOCK ATTRIBUTE TO POLYLINE OBJECT DATA.dwg

Link to comment
Share on other sites

I had a go and sort of got it to work, if you run the code line by line etc it works but via loading it does not really not sure what is going on. I think its in the ade_od command which is a Map function. So if any one wants to have a look I would appreciate it. You must have Lee-macs BurstUpgradedV1-3 lisp for it to work.

 

It may be a 2018 problem seems t0 work on 2013.

 

; take a attribute and explode block and add it as a object id field
; credit to lee-mac for his burst routine
; lee's burst routine must be in a supported path
; By Alan H July 2017
(defun c:att-objid ( / obj pt pt1 pt2 ss1 ss2 txt ent)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 512)

(setq obj (vlax-ename->vla-object (car (setq ent (entsel "PIck block pline edge")))))
(setq pt (cadr ent))

(foreach att (vlax-invoke obj 'getattributes)
(if (= "CAB_ID" (strcase (vla-get-tagstring att)))
(setq txt (vla-get-textstring att ))
)
)

(if (not LM:Burst)(load "BurstUpgradedV1-3"))

; empty selection set and  add 1 block
(Setq SS1 (ssadd))
(setq ss1 (ssadd (car ent) ss1)) 
(lm:burst ss1)

(setvar 'osmode 0)
(setq pt1 (polar pt (/ pi 4) 30))
(setq pt2 (polar pt (* 1.25 pi) 30))
(setq lst (list pt1 pt2))

(setq ss2 (ssget "F" lst))
(setq ent (ssname ss2 0))

(ade_odsetfield ENT  "CAB_INFO" "CAB_ID" 0 txt)
(setvar 'osmode oldsnap)
(princ "all done")
)
(c:att-objid)
; (ade_odgetfield ENT "CAB_INFO" "CAB_ID" 0) ; check if worked or use properties

Edited by BIGAL
Link to comment
Share on other sites

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