VBA OR LISP to create block with attribute

VBA OR LISP to create block with attribute

jalal.mousa
Advocate Advocate
916 Views
5 Replies
Message 1 of 6

VBA OR LISP to create block with attribute

jalal.mousa
Advocate
Advocate

Hi All,

hope someone can help me create VBA or Lisp to create attribute and then change it to block so I can extract data to excel

of course I know it take time and I am welling to pay if I have too

I need to create Lisp/VBA to create attributes to prompt  user to type text or select object as per the following:-

1: Room Number : ask me to type room number (default # 0001)

2:Room Name: ask me to type room name(default room name)

3:Floor Finish: ask me to select object and then bring back layer name

4: Area : ask me to select object and then bring back area of selected object

5: Length:ask me to select object and then bring back length of selected object

6:number of doors : ask me to type number of doors

7:wall finish: ask me type wall finish

8: wall qty : ask me to type wall qty

0 Likes
917 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend

INSERT command with your posted block already brings up quite a comprehensive pop-up for a user to fill in, is that not working well enough on your end?

 

Capture.PNG

0 Likes
Message 3 of 6

jalal.mousa
Advocate
Advocate

Hi,

The block works, but, what I am trying to do is adding this block every time I close polyline and change the block's reference object to the new closed polyline.

So, at the end of drawing any new polyline, it will prompt me to choose which object I would like to get the area, length and layer name from said object and update the block accordingly. instead of choosing each attribute in the block multiple times

Also, it would be ideal if I can retrieve the room number, room name, and layer from an excel table that I had already made and insert it into the block. Afterwards, the information such as the area and length as well as the number of doors from the block would be reinserted into said excel table.

Thanks.

 

 

 

0 Likes
Message 4 of 6

pendean
Community Legend
Community Legend
First, thank for for elaborating on your actual need. That's way more than your initial post.

Second: are you just using plain AutoCAD? The abilities and features you seem to want are stock (or modifable stock) options in AutoCAD ARCHITECTURE (or better yet, REVIT).





0 Likes
Message 5 of 6

Sea-Haven
Mentor
Mentor

When you insert a block you can populate the attributes at the time of insertion.

 

So you ask the questions 1st, pick objects, measure distances, layers etc then do the insert.

 

(command "-insert" "roomblk" (getpoint "pick point") 1 1 0 att1 att2 att3 att4 etc)

0 Likes
Message 6 of 6

jalal.mousa
Advocate
Advocate

Thanks for clarification

you are right but I am trying to avoid dealing with 3 different attribute that refer to same object

is there a way to select object once with out doing same for each attribute

this will save time and avoid mistakes 

 

0 Likes