Alexv Posted October 16, 2021 Posted October 16, 2021 Hi all, I'm having an issue trying to create a Dynamic Block that scales in size according to the user's input value. For example, I have 2 circles, 'Inside' and 'Outside'. I hope to allow the user to change the scale of the 'Inside circle' and 'Outside Circle' independently by typing in a value. Then the values would be display in a label. Please see attached diagram of what I've just described. Is it possible to have a few preset options for the 'Inside Circle' and 'Outside Circle' so that the user can choose from? And also allow them to enter in custom size. How would I go creating such dynamic block? The diagram is just a quick drawing and doesn't work. Thank you and have a good day. Quote
mhupp Posted October 16, 2021 Posted October 16, 2021 BricsCAD cant make dynamic blocks. so for the most part I only use standard blocks. To make it clean probably want a DCL that uses a drop down liste & pulling information with these. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-manipulate-a-dynamic-block-with-lisp/m-p/1605323/highlight/true#M208093 1 Quote
BIGAL Posted October 16, 2021 Posted October 16, 2021 You want something like this "multi radio button2.lsp" and I use lee-mac dynamic block lisp. You can have up to about 20 values per column dont have to have same amount per column.Multi radio buttons 2col.lsp if (not ah:buttscol)(load "Multi Radio buttons 2col.lsp")) (if (= ah:but nil)(setq ah:but 1)) (if (= ah:but2 nil)(setq ah:but2 1)) (setq lst1 (list "Select rad 1" "5" "7.5" "10" "12.5" "15" "other r1")) (setq lst2 (list "Select rad 2" "20" "25" "30" "35" "40" "other r2")) (ah:buttscol ah:but ah:but2 "Dual Circles" lst1 lst2) (setq ans1 (nth ah:2col ah:butlst)) (setq ans2 (nth ah:2col2 ah:butlst2)) 1 Quote
Alexv Posted October 22, 2021 Author Posted October 22, 2021 Hi everyone, thanks for all the replies. I apologies for the late reply. Work has been pretty hectic for the past week and I haven't gotten a chance to thank you guys until now. @mhupp Thanks for the info, I will check that out and play around with it. Much appreciated it! @BIGAL Thanks again Bigal for always helping me out. I really am grateful for the help. I'll test out the codes and see if I can get it to work for my issue. Quote
Alexv Posted October 23, 2021 Author Posted October 23, 2021 @BIGAL Hi Bigal, I tried out the lisp script you provided but I got an error message saying '; error: too few arguments'. I've been trying to resolve the issue by changing all the "ah" is the defun to "C:" and the script still wouldn't run. Any idea what is causing the issue? thanks for sharing the script. Much appreciated I'm hoping to create a dynamic block so I could use it for the tree, the trunk diameter and the canopy diameter. Hence, I want a list of standard trunk and canopy size for the user to quickly choose from or enter in custom size. Do you think a nested dynamic block would work in this case? Quote
BIGAL Posted October 23, 2021 Posted October 23, 2021 (edited) Just make a dynamic block with rad1 rad2 for the circles say both 1 unit dia. The code above is missing a ( at start sorry. Fixed it and this is closer to what you want. In CIV3d can do TR6*3 which means a 6m tree with a 300mm trunk so i did what you want and would update a tree block. (if (not ah:buttscol)(load "Multi Radio buttons 2col.lsp")) (if (= ah:but nil)(setq ah:but 1)) (if (= ah:but2 nil)(setq ah:but2 1)) (setq lst1 (list "Select spread 1" "2" "5" "10" "12.5" "15" "other r1")) (setq lst2 (list "Select trunk" "0.3" ".45" "0.6" "0.9" "1.2" "other r2")) (ah:buttscol ah:but ah:but2 "Dual Circles" lst1 lst2) (setq ans1 (atof (nth ah:2col ah:butlst))) (setq ans2 (atof (nth ah:2col2 ah:butlst2))) You are lucky here is treedyn.dwg, How do you intend to match to a point ? Edited October 23, 2021 by BIGAL Quote
Alexv Posted October 23, 2021 Author Posted October 23, 2021 @BIGAL Thankyou so much Bigal, that works great! I'm going to play around with it and see if I could add a dynamic field text label that displays the trunk and canopy diameters. Will let you know how that goes. Thanks again everyone. Y'all the best! Quote
BIGAL Posted October 24, 2021 Posted October 24, 2021 For anyone else bedit the treedyn block and look at dynamic properties. Quote
Recommended Posts
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.