Jump to content

lisp blocks on polyline


Nowak

Recommended Posts

lisp to insert blocks on polyline with excel

 

I want to insert under autocad, the PK, Y and Z columns on a polyline. The PK corresponds to the chaining of the polyline.
Thanks for your help

 

Edited by Nowak
Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Nowak

    15

  • BIGAL

    11

  • Jonathan Handojo

    2

  • Roy_043

    1

Top Posters In This Topic

Posted Images

If you think of it as X,Y,Z then no code required in cell N1 type 3dpoly, in cell N2 put this =CONCATENATE(B2,",",C2,",",D2) and copy down for all values. You should see as per image that x,y,z values have been made.

 

You then select column N starting at N1 and going down to last entry add 1 last blank line. For test xls this was N65

 

Use Copy or ctrl+c to copy the selection, go to Autocad click on command line and paste or ctrl+v 

 

A 3dpolyline should now appear.

 

image.thumb.png.0932acac1e680217c173548e2ceb8aeb.png

Link to comment
Share on other sites

Thank you for your contribution, but I am looking for how to insert the blocks on the polyline with, as information, the chaining of the polyline.
attached is the autocad file.
Thank you in advance.

 

Edited by Nowak
Link to comment
Share on other sites

Hello,
I want to insert the blocks, following a polyline, for that, I put the autocad file and the excel file, as an example. These blocks were inserted according to the excel file (PK, Y), but the concern is that I do not have the associated lisp.
In the Excel file, the BLOCK column is the name of the autocad block, Pk is the chaining of the polyline and Y is the position of the block relative to the polyline.
Thank you in advance for your contribution.
Link to comment
Share on other sites

If can work out what is required can be done, make 1 insert block at same co-ordinates  to match XLS input so can work it out.

 

Use 

 

Nice image !!
image.png.3f720b201728546c160846c4b73bb307.pngimage.png.f60c1db9df18ee14d28ae29e0f592c7f.png

 

Edited by BIGAL
Link to comment
Share on other sites

The other way is to copy the columns together to a new worksheet and save a CSV file which can be read in a Lisp program this is probably a easier way to go..

 

BLOC,PK,Y,Z,,,,,,,,
Montage tension - compression G- Axe ET,38.03961,-2.6873,70.206,,,,,,,,
Montage tension - compression G- Axe ET,74.08152,-3.2254,70.534,,,,,,,,
Montage tension - compression G- Axe ET,101.03403,-2.6825,70.77,,,,,,,,
,427.70479,-3.0395,0,,,,,,,,
,477.18136,-3.0395,0,,,,,,,,
,526.67798,-3.0395,0,,,,,,,,
Montage tension - compression V1- int rel2 AT 2 Anc,576.18407,-3.3495,73.075,,,,,,,,
Montage tension - compression V1 - Anti2,639.13145,-3.0395,73.489,,,,,,,,

 

 

image.png.cd51fa027e94389da9b027b20ad42809.png

 

Lisp will follow soon.

 

Edited by BIGAL
Link to comment
Share on other sites

I found an error in the paste method so concatenate should be as per this excel changed block name as was not in dwg provided. You just copy the column to the command line, some lines do not have block names so don't copy those.

 

inserBloc3D implantation caténaire avec Z_BVC_Meta (2).xls

screenshot179.png

Edited by BIGAL
Link to comment
Share on other sites

On 3/28/2020 at 3:17 AM, BIGAL said:

The other way is to copy the columns together to a new worksheet and save a CSV file which can be read in a Lisp program this is probably a easier way to go..

 

BLOC,PK,Y,Z,,,,,,,,
Montage tension - compression G- Axe ET,38.03961,-2.6873,70.206,,,,,,,,
Montage tension - compression G- Axe ET,74.08152,-3.2254,70.534,,,,,,,,
Montage tension - compression G- Axe ET,101.03403,-2.6825,70.77,,,,,,,,
,427.70479,-3.0395,0,,,,,,,,
,477.18136,-3.0395,0,,,,,,,,
,526.67798,-3.0395,0,,,,,,,,
Montage tension - compression V1- int rel2 AT 2 Anc,576.18407,-3.3495,73.075,,,,,,,,
Montage tension - compression V1 - Anti2,639.13145,-3.0395,73.489,,,,,,,,

 

 

 

 

Lisp will follow soon.

 

how do we insert these points in autocad ??

 

Edited by Nowak
Link to comment
Share on other sites

I make the copy paste, but autocad put me unknown command "0", 
yet I have the block insert in the autocad drawing

 

 

Edited by Nowak
Link to comment
Share on other sites

when wanting to insert the block, in script version or by excel, autocad considers that it is a command and not the name of the block
Link to comment
Share on other sites

Make sure the block exists in a blank dwg else it will work but will be to far away to see in a current dwg.

 

I tested again

 

paste to command line

Zoom E

-vpoint 1,1,1

Tram posts.xls

Edited by BIGAL
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...