Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script drawing defined shape in many locations

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
713 Views, 6 Replies

Script drawing defined shape in many locations

Hi,

 

I've found a number of resources detailing how to draw circles or squares (or other predefined shapes) at various locations with a script but would like to draw a different shape (say, a dog) that I've created.

 

Basically, I've made a series of custom shapes and would like to supply a list of center point coordinates and have the software draw them there. Is this possible/easy? Or would I be better off drawing the things in another program then importing them as a vector graphic?

 

Cheers,

Ben

Tags (2)
6 REPLIES 6
Message 2 of 7
pendean
in reply to: Anonymous

Q: why not have these shapes are blocks and just insert them with this script instead of the agony of having to code for "drawing" each from scratch?
Message 3 of 7
steven-g
in reply to: Anonymous

From the sound of your description I would say that turning your shapes into blocks would be the best method, you can define the center point as the blocks base point and a block can be scaled and rotated easily, as well. Though a script would be possible it makes no logical sense. Unless there are other reasons for wanting to use a script

Message 4 of 7
Anonymous
in reply to: pendean

"Blocks" sound like a great way to do this. I have to admit my ignorance here, which is why I didn't suggest blocks to start with. 

 

Rephrased:  Is it relatively simple to programmatically draw ~500 blocks by providing a list of center points?

Message 5 of 7
pendean
in reply to: Anonymous

It relatively simple to programmatically to INSERT PRE-DRAWN ~500 blocks by providing a list of center points if you are willing to take the time to populate the database that does that first.
Message 6 of 7
steven-g
in reply to: Anonymous

Iit's fairly straightforward in excel, if you use columns A and B to populate your x,y coordinates then use column C with 2 simple formulas, shown in the image

Insert.jpg

cell C1 starts the insert command using the name of a block that is already defined in your drawing with the correct center point

cell C2 has the formula to give the coordinates and this is copied down for as often as you need

I have used column D just to show where you have to use a space in the formula indicated with "°" because some places you have to use a single space and others require a double space.

Select the indicated cells and press Ctrl+c (copy) then in autocad make sure the command line is active click on it twice and then press Ctl+v (paste)

Be aware that zoom level and other objects in the drawing can influence how this works

 

 

Message 7 of 7
Emmsleys
in reply to: Anonymous

Feel free to post back if you continue to run into any issues or need additional help. 



Sarah Emmsley
Technical Support Specialist

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report