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:
BLOCK | DISTANCE |
BLCK1 | 10 |
BLCK2 | 20 |
BLCK3 | 30 |
BLCK4 | 40 |
Can someone help me? Thanks! Much love from Brazil!
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
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
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. 😕
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.
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
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.
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.
Attached are the files I used .
Can't find what you're looking for? Ask the community or share your knowledge.