Jump to content

Using the points of Divide command.


Cunha

Recommended Posts

How to put in a list, the first, the last and all the other points from entity obtaineds with the DIVIDE command?

Edited by Cunha
Link to comment
Share on other sites

AutoCAD pre 2000? How pre are we talking?

 

First guess.....DATAEXTRACTION command. Many options available. Can output to two or more file formats depending on the version of AutoCAD being used.

 

Second guess.....the LIST command. Using this option will give you the X, Y and Z coordinates of each point. Copy/paste the information presented in your text window (F2).

Link to comment
Share on other sites

AutoCAD pre 2000? How pre are we talking?

 

First guess.....DATAEXTRACTION command. Many options available. Can output to two or more file formats depending on the version of AutoCAD being used.

 

Second guess.....the LIST command. Using this option will give you the X, Y and Z coordinates of each point. Copy/paste the information presented in your text window (F2).

 

>>>>>>>>>>>>>>>

First answer: I don't know how to explain it better, I asked how to form a variable containing the list of points.

Second answer: There is no way to use Copy/Paste to hundreds of points.

Extra answer: The AutoCad is R14 but I think it makes no difference for AutoLisp (in this specific case). Thanks for help.

>>>>>>>>>>>>>>>

Link to comment
Share on other sites

Guess I missed the part where you asked "how to form a variable". Perhaps you should have posted in the AutoLISP forum for starters. This is the Student Questions forum (as in help with homework and assignments).

 

So now you are asking for a lisp routine that will extract the point information. Is that correct? And what exact information are you looking for?

 

One possible solution can be found here...http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extract-point-data-calling-all-lisp-gurus/td-p/885377

 

Another possible solution can be found here...http://www.cadtutor.net/forum/showthread.php?9628-Export-Points

 

I'm sure you can find other custom lisp routines that will accomplish the same task if you try.

Link to comment
Share on other sites

Sounds to me like this is a LISP question. Cunha, I believe, is wanting to create a list using AutoLISP from points using Divide. This thread may need to be moved to the appropriate forum. I will flag it so the poster can get help.

Link to comment
Share on other sites

First record the last entity ( including sequential ) prior to calling DIVIDE :

 

[b][color=BLACK]([/color][/b]defun c:div [b][color=FUCHSIA]([/color][/b]/ le ss pl[b][color=FUCHSIA])[/color][/b]

[color=#8b4513];;;RECORD THE LAST ENTITY[/color]
 [b][color=FUCHSIA]([/color][/b]setq le [b][color=NAVY]([/color][/b]entlast[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]entnext le[b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]setq le [b][color=MAROON]([/color][/b]entnext le[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

[color=#8b4513];Then DIVIDE[/color]
 [b][color=FUCHSIA]([/color][/b]setvar [color=#2f4f4f]"CMDECHO"[/color] 1[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]command [color=#2f4f4f]"_.DIVIDE"[/color][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]> [b][color=MAROON]([/color][/b]getvar [color=#2f4f4f]"CMDACTIVE"[/color][b][color=MAROON])[/color][/b] 0[b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]command pause[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

[color=#8b4513];;;Gather the POINT or INSERT Entities created by DIVIDE[/color]
 [b][color=FUCHSIA]([/color][/b]if [b][color=NAVY]([/color][/b]setq le [b][color=MAROON]([/color][/b]entnext le[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
     [b][color=NAVY]([/color][/b]progn
       [b][color=MAROON]([/color][/b]setq pl nil
             ss [b][color=GREEN]([/color][/b]ssadd[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
       [b][color=MAROON]([/color][/b]while le
              [b][color=GREEN]([/color][/b]setq pl [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 10 [b][color=TEAL]([/color][/b]entget le[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] pl[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b]
              [b][color=GREEN]([/color][/b]ssadd le ss[b][color=GREEN])[/color][/b]
              [b][color=GREEN]([/color][/b]setq le [b][color=BLUE]([/color][/b]entnext le[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
       [b][color=MAROON]([/color][/b]setq pl [b][color=GREEN]([/color][/b]reverse pl[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

[color=#8b4513];;;PICKSET ss [b][color=FUCHSIA]([/color][/b] to ERASE or whatever [b][color=FUCHSIA])[/color][/b][/color]
[color=#8b4513];;;POINT LIST pl[/color]

[b][color=FUCHSIA]([/color][/b]prin1 pl[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

Because DIVIDE creates point entities, all of the lists in pl are WCS. No error traps included. -David

Edited by David Bethel
Add PICKSET ss
Link to comment
Share on other sites

The other way to go is to create the points using a lisp not divide this way you can do 1 object at a time including a pline. The code that is close is "chainages along a pline", you would have to amend it to either create points or just make a list of points. Search here.

 

David ; error: bad argument type: lentityp nil ?

Link to comment
Share on other sites

Hi tzframpton, thanks for attention. I am traying to undestand and rewrote an old rotine I wrote decades ago. The pourpose is to flat aluminum sheet for aircraft construction. I think you is right. If you have time tell me what is "flag the post". Thank you. Best regards, Cunha.

Link to comment
Share on other sites

Hi David, thank you very much for clear commentary and the routine. I will try to understand it (maybe in some weeks) and will send you a feedback. Best regards, Cunha.

Link to comment
Share on other sites

Hi Bigal, thanks for reply. I have not informed that the divide command is over polylines 3d, so I think your suggestion will not works (to me). Even so I thank you very much. Best regards.

Link to comment
Share on other sites

In 2013 3dplines are supported as a divide option. Did you check your pre 2000. Else you will need to search for a "3dpline insert points" lsp etc, they are out there, I dont have one.

Link to comment
Share on other sites

In 2013 3dplines are supported as a divide option. Did you check your pre 2000. Else you will need to search for a "3dpline insert points" lsp etc, they are out there, I dont have one.

 

 

Ok BIGAL, thanks. David posted a great routine, I think this literally killed the riddler. Best regards, Cunha.

Link to comment
Share on other sites

Great! Davi. A kind of illogical logic but it works! This will be very useful for me. My lisp is a machete near your scalpel !

 

 

 

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...