Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to place blocks along a polilyne using a excel or csv list?

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
546 Views, 8 Replies

How to place blocks along a polilyne using a excel or csv list?

Hey guys, i've got some problems with a block insertion in cad. I have to place a lot of blocks along a polyline but taking the informations (block id and distance) from a list. The distance and blocks name will not be equal. My list have this layout:

BLOCKDISTANCE
BLCK110
BLCK220
BLCK330
BLCK440

Can someone help me? Thanks! Much love from Brazil!

Labels (1)
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Look into the measure command using blocks

Message 3 of 9
Thomas_Stuehle
in reply to: Anonymous

Hello @Anonymous 

 

Welcome to the AutoCAD Forum.

 

Please have a look at the following two articles:

These article should give you the needed steps or at least a starting point for your situation.

 

Could the information provided help you and answer your question? 

 

If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information. If not please don't hesitate to give an update here in your topic so all members know what´s the progression on your question is and can suggest next steps that might be helpful for you to achieve what you´re looking for. 

 

Best regards,

Thomas 

-----------------------------
You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution' button.


Thomas Stühle
Technical Support Specialist
Message 4 of 9
parkr4st
in reply to: Thomas_Stuehle

The distance and blocks name will not be equal. 

does this mean?

block1 is 10 units from the end of the line, block2 is 20 units further along = 30, block3 is 30 units further along = 60, etc?

is the line straight? or a curve or spline?  

can you provide a dwg file of the line?

 

dave

 

Message 5 of 9
Anonymous
in reply to: Anonymous

Te measure command isnt effective for this kind of problem. The blocks distances will no be equal. 

Message 6 of 9
Anonymous
in reply to: Thomas_Stuehle

Hi, Thomas! As i said, this commands are not effective for this kind of problem. As you saw, the blocks will not be placed at a equal interval. 😕

Message 7 of 9
Anonymous
in reply to: parkr4st

Whats up! I think maybe i have expressed it badly. The distances from te beginning of the line will not have the same interval or distance: one block can be inserted at 15 meters and another at 125, for example. And the line, or polyline, will have a curve format but will not be a spline.

 

Message 8 of 9
parkr4st
in reply to: Anonymous

It can be done with measure.  It will take some work and time and relevant to the number of blocks may be best handled with LISP.  a quick web search did not find one.

 

draw the line, new layer & set current, DDPTYPE to a visible point style such as an "X", MEASURE  interval for distance to the first point, place the block on another layer, QSELECT the layer with the points and erase those points,  repeat again for the next interval, etc .  Probably time consuming beyond reasonable but it will work.  look for least common denominator for the interval.  i.e if all the blocks are at intervals with 5 ( 15, 85, 125, 170 for example) as LCD  you can count by fives along the line and put the blocks where needed.

 

dave

Message 9 of 9
leeminardi
in reply to: Anonymous

The measure command has potential for a solution but it presents two challenges to be fully automated from a list of commands generated by Excel.

1.  Measure may create more than one instance of the block.  The length specified will be used to create as many blocks as necessary to fill the length of  the polyline.   You would need to manually delete all but the first instance.

2. The measure command prompts the user to "Select object to measure:".  The command will not accept a "p" (previous) nor a "g" (for group) at this point.  It will accept a vlisp point name variable so vlisp could be used to select the polyline for subsequent blocks but I have encountered a problem with this approach.

 

The attached Excel file uses the concatenate command to build vlisp statements.  It uses char(34) to generate quote marks that are need in the vlisp statement as opposed to quote marks needed for the concatenate function.

 

Before using the commands you must define a point on the polyline.  This can be done with the command (using osnap nearest):

(setq pt (getpoint "\nSpecify point on the polyline"))

Copying and pasting column C into the AutoCAD command line or creating a script produces the same result.  Only the first line gets successfully executed.  Not sure why.

image.png

The full contents of cell C2 is:

=CONCATENATE("(command ",CHAR(34),"_measure",CHAR(34)," pt ",CHAR(34),"b",CHAR(34)," ", CHAR(34),A2,CHAR(34)," ",CHAR(34),"Y",CHAR(34)," ",B2," ",CHAR(34),CHAR(34),")")

Here are the results.  As noted, only the first execution is successful. 

image.png

 

Attached are the files I used .

 

lee.minardi

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

Post to forums  

Forma Design Contest


AutoCAD Beta