Reaper_of_Lykos Posted May 3, 2023 Posted May 3, 2023 I have a block that represents a section of a duct. It has custom properties of "Duct_Width". I am trying to gte the property through lisp using: (vlax-get-property (vlax-ename->vla-object (car (entsel))) "Duct_Width") but I get an error saying "unknown name: Duct_Width". Is it that vlax-get-property does not work on customized parameters? Is there a way I can retrieve "Duct_Width"? And if possible, how to set it? Thank you very much. Quote
ronjonp Posted May 3, 2023 Posted May 3, 2023 Sounds like a dynamic block. Post a sample drawing. Quote
Lee Mac Posted May 3, 2023 Posted May 3, 2023 Try using my Get Dynamic Block Property Value function, e.g.: (LM:getdynpropvalue (vlax-ename->vla-object (car (entsel))) "Duct_Width") Quote
Reaper_of_Lykos Posted May 4, 2023 Author Posted May 4, 2023 20 hours ago, ronjonp said: Sounds like a dynamic block. Post a sample drawing. It is a dynamic block indeed. Please see attached sample duct. Duct Sample.dwg Quote
ronjonp Posted May 4, 2023 Posted May 4, 2023 8 minutes ago, Reaper_of_Lykos said: It is a dynamic block indeed. Please see attached sample duct. Duct Sample.dwg 149.41 kB · 0 downloads Lee's got you covered in the post above. Quote
Reaper_of_Lykos Posted May 4, 2023 Author Posted May 4, 2023 20 hours ago, Lee Mac said: Try using my Get Dynamic Block Property Value function, e.g.: (LM:getdynpropvalue (vlax-ename->vla-object (car (entsel))) "Duct_Width") Hi Lee Mac, your function works great, as well as the set property one, thanks a lot! Quote
Lee Mac Posted May 4, 2023 Posted May 4, 2023 1 hour ago, Reaper_of_Lykos said: Hi Lee Mac, your function works great, as well as the set property one, thanks a lot! Great stuff - you're welcome! Quote
BIGAL Posted May 5, 2023 Posted May 5, 2023 Thanks to you Lee this is insert a block and pop the visibility states in a dcl so can choose rather than go to properties to set. ; Change dynamic block properties when inserting look at properties available. ; By Alan H June 2022 ;; Get Dynamic Block Property Allowed Values - Lee Mac ;; Returns the allowed values for a specific Dynamic Block property. ;; Set Dynamic Block Visibility State - Lee Mac ;; Sets the Visibility Parameter of a Dynamic Block (if present) to a specific value (if allowed) ;; Get Visibility Parameter Name - Lee Mac ;; Returns the name of the Visibility Parameter of a Dynamic Block (if present) (defun insdynv (blkname / pt obj lst ans) (if (not LM:setdynpropvalue )(load "Lee-mac Dynamic block get-put")) (setq pt (getpoint "\nPick a pt for block ")) (command "-insert" blkname "s" 1.0 pt 0) (setq obj (vlax-ename->vla-object (entlast))) (setq visval (LM:getvisibilityparametername obj)) (setq lst (LM:getdynpropallowedvalues obj visval)) (setq lst (cons "Please choose" lst)) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (not AHbut)(setq AHbut 1)) (setq ans (ah:butts 1 "v" lst)) (LM:SetVisibilityState obj ans) (princ) ) ; set existing block visibilty (defun insdyne (blkname / pt obj lst ans) (if (not LM:setdynpropvalue )(load "Lee-mac Dynamic block get-put")) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (setq obj (vlax-ename->vla-object (car (entsel "\nPick a dynamic block ")))) (setq visval (LM:getvisibilityparametername obj)) (setq lst (LM:getdynpropallowedvalues obj visval)) (setq lst (cons "Please choose" lst)) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (not AHbut)(setq AHbut 1)) (setq ans (ah:butts 1 "v" lst)) (LM:SetVisibilityState obj ans) (princ) ) Need multi radio buttons save in a support path location or edit the (load "Multi radio buttons") with correct path. Same with input values would use Multi getvals.lsp with LM:getdynprops Multi radio buttons.lsp 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.