+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Forum Newbie
    Discipline
    Facilities Mgmt
    Lee94's Discipline Details
    Occupation
    Data Analyst
    Discipline
    Facilities Mgmt
    Using
    Map 3D 2017
    Join Date
    Feb 2014
    Posts
    6

    Default BLOCK ATTRIBUTE to POLYLINE OBJECT DATA

    Registered forum members do not see this ad.

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

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    Registered forum members do not see this ad.

    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.

    Code:
    ; 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
    Last edited by BIGAL; 23rd Jul 2017 at 07:32 am.
    A man who never made mistakes never made anything

Similar Threads

  1. Replies: 0
    Last Post: 2nd Sep 2015, 08:13 pm
  2. Batch Block Attribute Data Extraction with Wildcard in Block Name..?
    By lamensterms in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 0
    Last Post: 5th Mar 2014, 03:35 am
  3. Object Data to Attribute Data to perfection
    By cris2fur in forum AutoCAD General
    Replies: 13
    Last Post: 30th Nov 2011, 06:39 am
  4. Attribute data to hyperlink of the same block
    By Jaap Marchal in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 10th Dec 2010, 10:06 pm
  5. Repeating data in Attribute Block
    By andythoms in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 18th May 2010, 09:59 am

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts