I need to set the lookup parameter of a dynamic block.
I can get the block using (and if anyone can tell me how to get an selection set without zooming, I'd be very grateful)
(CHGDYNPROP
(ssname SSet
0) "Lookup1" Lookup
)
and then run it through the routine
(defun CHGDYNPROP
(Ename propname newval
/ obj v vval sal tot i
) ;; Changes a given variable in your block
;; Passed: Ename, Property Name, New value for Property
;;
Ename
v (vla-getdynamicblockproperties obj)
sal
(vlax
-safearray
->list vval
) i 0)
)
)
)
)
This all work great as long as the block is in a location I can zoom to and then grab. The problem is when it has been moved to a different location on the screen.
This doesn't work because the block's name has changed to an anonymous block name:
(SSGET "X" '
((2 .
"BLOCKNAME")))
I've tried this:
(= :vlax-true (vla-get-IsDynamicBlock block))
)
(CHGDYNPROP block "Lookup1" Lookup)
);if
);vlax-for
);defun
I can find the block okay, I think. When I inspect the variable "block" it says its a VLA-OBJECT |AcadBlock. I try to get info on different parts and I get errors. Since the subroutine will accept enames, I tried (vlax-vla-object->ename block) and it returns the ACAD BLOCK_RECORD. I don't know how to handle this.
What is the way to get this block in a form that I can use the CHGDYNPROP subroutine to set the lookup parameter?
Thanks,
Rabbit