Jump to content

help generating blocks with attributes from equipment list in csv format


oompa_l

Recommended Posts

Hi

I'm not sure what the way to go about doing what I want. I have a pretty extensive equipment list that I want to drive the deneration of simple plan represenations - each would be a rectangle with width and length and maybe some text fields identifying the obect. Does anyone have any solutions for something like this? Do I need to write it from scratch in LISP?

 

thanks

O

Link to comment
Share on other sites

It would make any answers more to the point, if you could post a few samples to show what it is you want to achieve, and the sort of information you have to start with.

Link to comment
Share on other sites

i've attached a starting point I just put together. I made a dynamic block with width and length parameters. I made some attributes for the equipment's id, its height and weight.

 

My csv will have fields like the following:

ID Program Qty Equipment Name L (in) W (in) H (in) Wt (kg)

MACH01 MACHINING 5 Kondia Mills 60 65 85 1200

MACH02 MACHINING 8 Maximart Mills 67 72 87 1000

MACH03 MACHINING 17 Bridgeport Mills 60 65 82 1180

MACH04 MACHINING 20 Colchester Lathes 105 50 52 1500

 

I want each instance of the block to pick up the width and height and represent them in the rectangle. I want the "ID" "H" and "Wt" values to show up as attributes. Alternatively, each instance could be its own block I suppose, instead of the same one being adjusted by its dimensions.

 

Please let me know if you need more info to understand.

thanks so much!EQP-BLOCK-02.dwg

Link to comment
Share on other sites

This is a simple output for a partial block generated using excel, you can copy and paste the text directly into Autocad's command line, or run it as a script. It can also be copied directly from an excel spreadsheet or using VBA output as a text file or Autocad script file. Having said that LISP may offer better options, if any LISP programmers are about.

-attdef

ID

MACH01
20,20
3
0


Program

MACHINING

rectangle
0,0
60,65
-block
test
0,0
all

-insert
test
0,0
1
1
0

Link to comment
Share on other sites

The only thing missing in a simple script is how you are going to do the insertion point for the block, compare the two lines below expects the block MACH01 to exist use steven-g code to create. NOTE the spaces not ","

 

Insert MACH01 (getpoint) 1 1 0 "MACHINING 5 Kondia Mills" 60 65 85 1200

MACH01 MACHINING 5 Kondia Mills 60 65 85 1200

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