Jump to content

Donut lisp


joa0009

Recommended Posts

modify the code so that it only displays the donuts and at the end display the number of donuts on the drawing
 

47A9BB03-211A-47E8-AF8E-0600FF0C7B6F.jpeg

Link to comment
Share on other sites

All that code is doing is.

if the user select something

       stepping though each item

                 say what it is.

 

If you selected 3 lines it would output

 

line

line

line

 

is donuts a block?  check this out

Link to comment
Share on other sites

2 minutes ago, mhupp said:

All that code is doing is.

if the user select something

       stepping though each item

                 say what it is.

 

If you selected 3 lines it would output

 

line

line

line

 

is donuts a block?  check this out

image.thumb.png.bc42d9fe674d72881c38ac13e4cbad8b.png

Link to comment
Share on other sites

This selects lwpolylines that are closed and have only have 2 radius aka donuts. maybe something else idk donuts dont really have a call out like other entity like lines, blocks, circles from what Im reading. Will select everything it counted when the command ends.

 

You don't need to step thought everything take your if statements and apply them in the ssget.

 

(defun C:TEST ()
  (setq SS (ssget "X" '((0 . "lwpolyline")(70 . 1)(90 . 2))))
  (prompt (strcat "\n"(itoa (sslength SS)) " Donuts in the Drawing"))
  (sssetfirst nil SS)
  (princ)
)

 

Edited by mhupp
  • Thanks 1
Link to comment
Share on other sites

however if your teacher (unless it is Mr Mac himself) had any credibility they would credit the original source of the code

  • Like 1
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...