I'm looking to incorporate a LISP command into a dynamic block

I'm looking to incorporate a LISP command into a dynamic block

cclawsonD6QHU
Explorer Explorer
801 Views
31 Replies
Message 1 of 32

I'm looking to incorporate a LISP command into a dynamic block

cclawsonD6QHU
Explorer
Explorer

So I'm very new to LISP Commands and think I have something that will do what I want it to do, however I want it inside a dynamic block that will update as I stretch it, (basically I want to associate a line with a divide command making equal parts at or under 12" on center) I have no idea how to do that, so any help would be greatly appreciated. (the line in question is the gray line with the drill holes on each end)

Attached are both the block and LISP 

thanks

0 Likes
Accepted solutions (1)
802 Views
31 Replies
Replies (31)
Message 21 of 32

Moshe-A
Mentor
Mentor

@cclawsonD6QHU ,

 

thanks you for that, i found a bug and fix it - file attached

0 Likes
Message 22 of 32

Moshe-A
Mentor
Mentor

@Sea-Haven hi,

 

Excellent idea Allen, love it 🙏 thank you

 

Moshe

 

 

0 Likes
Message 23 of 32

cclawsonD6QHU
Explorer
Explorer

so from what I understand of that code is should work for any future blocks so long as I use the same layers and add the block name to the setq MA?

also they just changed those drill holes to 3/16" so should I change the 
(setq radius-feet (/ 1 16 12.0)) ; 1/16 inch expressed as feet to

(setq radius-feet (/ 3 32 12.0)) ; 3/32 inch expressed as feet?

Thanks again so much you are awesome?

0 Likes
Message 24 of 32

Moshe-A
Mentor
Mentor

yes

 

but in order to make it support multiple blocks, multiple layers  i need to make more changes.

0 Likes
Message 25 of 32

cclawsonD6QHU
Explorer
Explorer

so it wouldn't just work if I  changed

 

; define some const globals
(setq MA:BLKNAME "square panel") ; const
(setq MA:DRILL_LINE_LAYER "guide lines") ; const
(setq MA:DRILL_HOLES_LAYER "+drill holes") ; const

 

to

 

; define some const globals
(setq MA:BLKNAME "square panel") ; const

(setq MA:BLKNAME "corner panel") ; const
(setq MA:DRILL_LINE_LAYER "guide lines") ; const
(setq MA:DRILL_HOLES_LAYER "+drill holes") ; const

 

and just add the new block?

 

sorry if my questions seem dumb I'm trying to learn it as well as have it work lol.

I'm taking a course on it but so far It hasn't touched on anything to do with blocks.

Thanks again you are so super helpful.

0 Likes
Message 26 of 32

Moshe-A
Mentor
Mentor

@cclawsonD6QHU  hi,

 

Here is an update to support multiple blocks as multiple layers.

 

A new variable (the 3 previous gone  😀) called MA:DATALIST, list of items each has 3 strings where first string is block name,

second string is layer for lines, third string is layer for drills.

you can add more blocks and layers. it is important not to break the format (if you do? it won't work)

 

                                       ; block name      guide line    drill hole
(setq MA:DATALIST '(("square panel" "guide lines" "+drill holes")
                                     ("corner panel" "guide lines" "+drill holes")
                                  ); list
); setq

 

Moshe

 

 

0 Likes
Message 27 of 32

cclawsonD6QHU
Explorer
Explorer

I see... Thank you for that I will go over the new code and see if I can understand exactly what you did to make it work thank you so much for your help!

 

to clarify I would need to alter this bit to add more blocks?

 

   ; block name      guide line    drill hole
(setq MA:DATALIST '(("square panel" "guide lines" "+drill holes")
("corner panel" "guide lines" "+drill holes")
("angled panel" "guide lines" "+drill holes")
   ); list
); setq

 

 

 

0 Likes
Message 28 of 32

Moshe-A
Mentor
Mentor

yes exactly

 

 

0 Likes
Message 29 of 32

cclawsonD6QHU
Explorer
Explorer

great you are a god send! seriously your help has saved me an unholy amount of time.

0 Likes
Message 30 of 32

Moshe-A
Mentor
Mentor

found 2 more bugs  😩 now fixed 💪

0 Likes
Message 31 of 32

cclawsonD6QHU
Explorer
Explorer

thank you so much! I have it working for all the different panels now and it saves so much time and chance of error.

0 Likes
Message 32 of 32

cclawsonD6QHU
Explorer
Explorer

So I've been doing a bit of research and I think I've come up with a plausible solution to my new problem. however I'm unsure whether It will fully work as I have yet to figure it out...  my need is to add weep holes at the center line of the drill holes on the bottom of selected panels only. the idea is to use the y axis to limit the command to only work on the guide lines on the 0 y coordinates for example, and then just make sure all panels that require the weep holes fall onto that plane... my major issue is the actual code, as I've been unable to find an example to follow, that deals with both the y constraint and putting something centered between two center points... if you know of a sight or video that would help me figure it out that would be much appreciated or even an explanation would do.

Thanks.

0 Likes