Jump to content

gutting dynamic block of rods


catoscuro

Recommended Posts

HELLO, I HAVE A DYNAMIC BLOCK THAT PLACES A CERTAIN NUMBER OF CIRCLES (RODS) BETWEEN THE EXTREME CIRCLES, THE DISTANCE BETWEEN THE EXTREME CIRCLES MAY BE VARIABLE, YOU CAN ALSO VARY THE DIAMETER OF THE CIRCLES, I WANTED TO REPLICATE THE BLOCK, BUT I CAN'T , SOMEONE WOULD BE SO KIND TO EXPLAIN TO ME THE STEP BY STEP OF THE APPLICATION OF THE ACTIONS, THANK YOU

Bar LLENOEPAPAQUI_LOOKUP.dwg

Link to comment
Share on other sites

no, although it would be interesting if it could, I didn't know where to put this topic. My question with this block is how to do the stretch along with the scale action.

Link to comment
Share on other sites

The dwg is filled circles , as suggested very easy as a lisp, start, end points, rad required, how many all done. But would be individual objects probably a block. A circle 1 unit dia, solid fill. 

 

image.thumb.png.59da2daad1a1bf6e50574255bbca1bab.png

image.png

Link to comment
Share on other sites

Try this, you need multi getvals.lsp so save in a support path directory. Or change the Load to include its location. I made a block from your left circle/hatch called Circhat.

 

; https://www.cadtutor.net/forum/topic/74671-gutting-dynamic-block-of-rods/
; 
; Circles between 2 pts. BY AlanH March 2022


(defun c:circ2pts ( / ans rad pt1 pt2 dist len lenspc num)


(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Radius " 5 4 "1" "No." 5 4 "5")))
(setq rad (atof (car ans)) num (atoi (cadr ans)))

(setq pt1 (getpoint "\nPick 1st point ") pt2 (getpoint pt1 "\nPick 2nd point "))
(setq dist (distance pt1 pt2) ang (angle pt1 pt2))

(command "-insert" "circhat" pt1 rad rad 0)

(setq lenspc 0.0 len (/ dist (+ num 1)))
(repeat (+ num 1)
(setq lenspc (+ lenspc len))
(command "-insert" "circhat" (polar pt1 ang lenspc) rad rad 0)
)
(princ)

)
(c:circ2pts)

Multi GETVALS.lsp

Edited by BIGAL
Link to comment
Share on other sites

Bigal. thank you very much for your time and effort,
when executing the routine I get the following error, "Command: (LOAD "C:/LISP/BY DATE/March 2022/rods/circ2pts.lsp")
(1 4)
Pick 1st point
Pick 2nd point 0
; error: bad argument type: fixnum: 5.0
Could you tell me what could be wrong, thanks again.

Link to comment
Share on other sites

1 I made 1 tiny mistake the num needed to be atoi changed code above. I may have changed during testing and not saved. 

 

2 the multi getvals is loading the way the code expects it to be in a support path, or save it to C:/lisp then its available to any program you want to use it with. Edit code.

(if (not AH:getvalsm) (load "C:\\LISP\\multi radio buttons.lsp")) 

 

There is Multi getvals.lsp, Multi Radio buttons col2.lsp & Multi toggles.lsp all library routines so it doesn't need to live in each user code.

 

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