Author Topic: Looking to insert blocks from ascii and then leader/label using attributes  (Read 2446 times)

0 Members and 1 Guest are viewing this topic.

alpha

  • Guest
Hey guys, long time lurker and first time poster here. Up until now I have found everything I have needed on the forums but I am having a hard time with this one. Maybe I'm not using the right search criteria.

Using data from an ascii file, I want to insert multiple blocks into my drawing and have the attributes filled out accordingly. Caddicted would suit this need but it is no longer for sale according to the website.

Afterwards, I want to leader/annotate these blocks with the attribute information.

Not asking anyone to write anything, just curious to see if anyone has had dealings in this area.

Mucho gracias in advance.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Looking to insert blocks from ascii and then leader/label using attributes
« Reply #1 on: February 16, 2012, 04:37:52 PM »
This old program of mine will do the block inserting and attribute inputting:

http://lee-mac.com/ptmanager.html

Maybe it will help?

alpha

  • Guest
Re: Looking to insert blocks from ascii and then leader/label using attributes
« Reply #2 on: February 16, 2012, 05:03:24 PM »
Thanks for the reply Lee. It doesnt look like this routine will fill out the attribute information like I'll need it to.

Sample data line looks like this: point, easting, northing, decription1, decription2, decription3, decription4, decription5

Hence the reason we were using caddicted, you could assign uses to columns. I may have to bribe one of our programmers to write something.

Any experience with creating labels from attribute info?

Thanks  :-)


HofCAD

  • Guest
Re: Looking to insert blocks from ascii and then leader/label using attributes
« Reply #3 on: February 17, 2012, 09:17:52 AM »
With the Dynamic Data Exchange (DDE) method.
1) Open in AutoCAD the drawing DuckOffice.dwg
2) Open in Excel the spreadsheet DuckOffice.xls
3) Click in Excel on the button 'Insert Blocks'
 to start the macro 'Blocks'.

Regards, HofCAD CSI.

PS For "Donald Duck Family Tree (US)" see: http://duckman.pettho.com/tree/v_american.html
« Last Edit: February 17, 2012, 10:11:01 AM by HofCAD »

HasanCAD

  • Swamp Rat
  • Posts: 1420
Re: Looking to insert blocks from ascii and then leader/label using attributes
« Reply #4 on: February 21, 2012, 02:48:11 AM »
With the Dynamic Data Exchange (DDE) method.
...

Error Message
I am using CAD2007
Excel 2003

fixo

  • Guest
Re: Looking to insert blocks from ascii and then leader/label using attributes
« Reply #5 on: February 21, 2012, 09:06:23 AM »
Thanks for the reply Lee. It doesnt look like this routine will fill out the attribute information like I'll need it to.

Sample data line looks like this: point, easting, northing, decription1, decription2, decription3, decription4, decription5

Hence the reason we were using caddicted, you could assign uses to columns. I may have to bribe one of our programmers to write something.

Any experience with creating labels from attribute info?

Thanks  :-)
Upload your ascii file and sample drawing (<=A2007) with blocks
I already have something similar on this but with my very own settings
so I think it would be easy to adapt this program to your data / blocks

Here is just an answer on your last part
Code: [Select]
((lambda ()
   (setq blk_obj (vlax-ename->vla-object (car (entsel "\nSelect block with attributes: "))))
   (setq pt (getpoint "\nLeader Arrow Point: "))

   (setq txt "")
   (foreach att_obj (vlax-invoke blk_obj 'getattributes)
     (setq attId (vla-get-objectid att_obj))
     (setq txt (strcat txt
       (strcat
"%<\\AcObjProp Object(%<\\_ObjId "
(rtos (vla-get-objectid att_obj) 2 0)
">%).TextString>%"
       )
       "\\P"
       )
     )
   )
   (setq txt (substr txt 1 (- (strlen txt) 2)))
   (alert "Hint:\nWhen the text editor window will open,\njust close it pressing button \"X\"")
   (vl-cmdf "_.acad_dim.mleader" pt (getpoint pt "\nLeader Text Location: ") "")
   (vla-put-textstring
     (vlax-ename->vla-object (entlast))
     txt
   )
   (vl-cmdf "_regen")
 )
)

~'J'~
« Last Edit: February 21, 2012, 11:08:35 AM by fixo »