DavidP Posted Thursday at 04:42 PM Posted Thursday at 04:42 PM Is it possible to select dynamic blocks and activate action parameters... similar to Shift+left click on block grips? (defun c:foo () (vl-load-com) (setq ssTestSet (ssadd)) (princ "\nSelect Test block(s): ") (setq ss (ssget '((0 . "INSERT")(2 . "`*U*")))) (if ss (progn (setq ssTestBlocks '()) (setq i 0) (repeat (sslength ss) (setq blkRef (ssname ss i) effname (vla-get-EffectiveName (vlax-ename->vla-object blkRef)) i (+ i 1)) (if (= (strcase effname) "TEST") (progn (ssadd blkRef ssTestSet) ) ) ) (if ssTestSet (progn (sssetfirst nil ssTestSet) ;Add Activate Position1 action parameter Code Here ;Similar to Shift+left click on grips ) (princ "\nNo blocks named 'Test' were found.") ) ) (princ "\nNo blocks found with names starting with '*U*'.") ) (princ) ) foo_ActionParameter.dwgFetching info... The scenario on the right is what I'm looking for. Quote
Emmanuel Delay Posted Friday at 09:37 AM Posted Friday at 09:37 AM I don't understand what you're trying to achieve Quote
DavidP Posted Friday at 12:50 PM Author Posted Friday at 12:50 PM I want to grab Postion1 for all the blocks selected and then allow the user to relocate all Positions1 in one go. Quote
BIGAL Posted Friday at 10:27 PM Posted Friday at 10:27 PM (edited) Ok 1st step is get a copy of this program by Lee Mac, https://lee-mac.com/dynamicblockfunctions.html You want to change the values of Position1_X & _Y, this can be done using Lee's code. ;; Set Dynamic Block Property Value - Lee Mac ;; Modifies the value of a Dynamic Block property (if present) ;; blk - [vla] VLA Dynamic Block Reference object ;; prp - [str] Dynamic Block property name (case-insensitive) ;; val - [any] New value for property ;; Returns: [any] New value if successful, else nil (defun LM:setdynpropvalue ( blk prp val ) Also look at LM:getdynpropvalue so get the current value and +- to that value. Have a go if you get stuck we are here. Edited Friday at 10:29 PM by BIGAL Quote
troggarf Posted 23 hours ago Posted 23 hours ago I selected both dumb blocks and dynamic blocks at all of the clickable points. I still don't understand what you speak of by saying "similar to Shift+left click on block grips?". I was curious that I missed out on something, but didn't see anything... Do you have a loaded tool that lets you Shift + left click on a grip that does something that the rest of us don't have? 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.