BIGAL Posted April 9, 2021 Posted April 9, 2021 (edited) I have noticed a few insert dynamic block and set the dynamic parameters and how to choose a Visibilty state as part of a lisp program rather than 2 steps, insert block and then update the visibility parameter by picking the new block. This allows you to read the visibilty states and display them in a dcl. It will dynamically match the number of states to around 20 max. It is screen dependent. You must down load the Edit dynamic block functions from Lee-mac.com I have them in a saved lisp file so load on demand or you can put in your code the correct functions. http://www.lee-mac.com/dynamicblockfunctions.html (if (not LM:getvisibilityparametername)(Load "lee-mac dynamic block functions")) Multi radio buttons is at Cadtutor\downloads. ; insert a dynamic block bname at a point X Y scale 1 rotation 0 with 1 attribute also being supplied ;add or remove attribute values (command "-Insert" bname point 1 1 0 "" val0) ; get block object for further processing (setq blk (vlax-ename->vla-object (entlast))) ; use lee-mac dynamic block functions to set the width and height (LM:setdynpropvalue blk "Width" wid) (LM:setdynpropvalue blk "Height" ht ) ; get the visibilty parameter names (setq visval (LM:getvisibilityparametername blk )) ; make a list of the allowed values (setq winlst (LM:getdynpropallowedvalues blk visval)) ; add "please choose" to start of list (setq winlst (cons "Please Choose" winlst)) ; load Multi Radio buttons.lsp a library dcl routine for any code (if (not AH:Butts)(load "Multi Radio buttons.lsp")) ; set defualt button to pick note can be amended so = last button picked (if (not AHbut)(setq AHbut 1)) ; run the multi radio buttons and choose a visibilty (setq ans (ah:butts2 1 "v" winlst)) ; set the visibility state (LM:SetVisibilityState blk ans) Edited April 9, 2021 by BIGAL 1 Quote
Lee Mac Posted April 9, 2021 Posted April 9, 2021 Thanks for sharing @BIGAL - I'm pleased that you could make use of my Dynamic Block Functions. To offer some food for thought, some time ago I created something similar posted here (refer to the second half of that answer for an example program). Quote
BIGAL Posted April 10, 2021 Author Posted April 10, 2021 Hi lee, using the list box method as you suggest is also the way to go when you have a lot of states as it supports scrolling, the multi radio has some spacing parameters in the current version, to make it more visually pleasing but if you have a lot of values squeezes the dcl so user could pick the wrong one. Just a side note if you have only a few states say 3 can also change the "V" to "H" in the code and will display dcl horizontal. The post being to show how it can be done and now have 2 choices thanks to you. 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.