Using excel location data to position blocks

Using excel location data to position blocks

Roy_Harvey
Participant Participant
1,106 Views
4 Replies
Message 1 of 5

Using excel location data to position blocks

Roy_Harvey
Participant
Participant

Currently using lighting design software that allows the position (XY), rotation of the lighting column and the height to be exported via CSV. Is there a way to import this CSV data directly into C3D blocks like you would with COGO points? I've seen many ways on here of extracting COGO points from blocks just looking for the reverse process.

0 Likes
Accepted solutions (1)
1,107 Views
4 Replies
Replies (4)
Message 2 of 5

Joe-Bouza
Mentor
Mentor

easy thing would import as cogo and assign you block as the point style. using Excel and the a raw description can do the rotation with Description Key

 

otherwise you will need to create a script to insert the blockname, x,y, scale, rotation 

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 5

AllenJessup
Mentor
Mentor
Accepted solution

Creating a Script as @Joe-Bouza mentioned isn't difficult. You can do it in Excel by creating columns. One to preface your locations with the -Insert command. Then 3 to contain the x,y, scale, rotation fields. Do it once in the drawing and duplicate it in the script file. Then save the CSV file as a SCR file.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 4 of 5

samir_rezk
Advisor
Advisor

Hi @Roy_Harvey 

Using the MAPIMPORT command you can import a csv file as AutoCAD Blocks! Just be sure to change the file type in the dialog (it usually defaults to other file types to import!)

Hope this helps,

 


Samir Rezk
Technical Support Specialist

Message 5 of 5

ChicagoLooper
Mentor
Mentor

Yes and no.

 

Yes you can use MAPIMPORT command to input your csv file and 'blocks' will be inserted. Although the blocks that MapImport will use will be correctly located, they  won't be 'your' blocks. In fact, you won't even have the opportunity to tell C3D which of your blocks you wish to use. AutoCad will therefore use a DEFAULT block named Map Survey Point and this block will look like a 'plus' sign (this is the 'default block' when executing the MapImport command). Why AutoCad doesn't give you the option to use your own block instead of a default block is due to AutoCad developers dropping the ball. Boo developers.

 

You can accomplish your goal of using you csv file to insert your light fixture blocks in at least two different ways: one is easy while the other is not so easy.

 

  1. Instead of exporting to csv from your other porgram, export to shapefile (of course I am assuming it is possible to export to shapefile in the first place). Then you can successfully use MAPIMPORT command. Using MapImport on a shapefile, as opposed to a csv, will allow you to select your own block from your own block library during the import procedure. Your blocks will be accurately positioned. <<This procedure does not require you to 'bring in' the shapefile, it only requires you to use it as a source file.>>
  2. For the not so easy way, you can do this:
    1. Import your csv to Map Survey points using MapImport command.
    2. Export the imported Map Survey Points to Shapefile (use MAPEXPORT Command).
    3. Perform a 'calculation' on the shapefile's database file so you'll get another column of data (you want another attribute whose field name is the same as your Lighting Fixture's TAG. You are essentially copying an existing field to a new field that has a new field name--this new field name is critical to your goal of inserting your blocks.)
    4. Export the shapefile to SDF including existing and new field names.
    5. MapImport the newly created SDF. Be sure to 'Create Object Data' during import and select your Lighting Fixture block from your library. The newly created field name will populate the attribute of your block, e.g. fixture 101A, 102A, 201R, 201S, 201T, etc.

What ever way you choose, you will need to use a query with Alter Properties to rotate your block. Using a csv to perform both insert AND rotate your lighting blocks is a multi-step process, not a one-step process. The Alter Properties portion of this procedure will read the rotation value taken from Object Data and rotate your block accordingly.

 

For an easy understandable explanation, upload your light fixture block and 6 to 10 lines of your csv so a video can be made.  

Chicagolooper

EESignature