resullins Posted May 26, 2011 Share Posted May 26, 2011 I have a dynamic block, attached, that has a visibility parameter for the connector type. I also have one visibility state that brings up an attribute so that you can manually edit the connector type for anything non-standard. I also have a little lisp that makes you able to select a whole bunch of blocks, use the command OTHER, enter a connector type, and it will fill in the atrribute for you. Kind of handy and quick for what we do. There's one little thing I'd like to add, though... I'd love it if when you selected blocks, entered OTHER, entered a connector type and pressed enter, it would automatically change the visibility state to the one that has the attribute in it. I hope that makes sense. Connector.dwg Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 26, 2011 Share Posted May 26, 2011 So, you want a routine that you can select a group of dynamic blocks, name the visibility state and it will set each to said specified visibility. Is this correct? Quote Link to comment Share on other sites More sharing options...
resullins Posted May 26, 2011 Author Share Posted May 26, 2011 Mostly. I only want it to change the visibility when you enter the OTHER command, and I want it to automatically select the OTHER visibility state. Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 26, 2011 Share Posted May 26, 2011 In a coding mood... (defun _toVisibilityState (obj visibilityState) (if (minusp (vlax-get obj 'IsDynamicBlock)) (vl-some '(lambda (x) (if (wcmatch (strcase (vla-get-PropertyName x)) "*VISIBILITY*") (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-value (list x visibilityState)))) ) ) (vlax-invoke obj 'GetDynamicBlockProperties) ) ) ) (defun c:Other (/ ss i) (if (setq ss (ssget "_:L" '((0 . "INSERT")))) (repeat (setq i (sslength ss)) (_toVisibilityState (vlax-ename->vla-object (ssname ss (setq i (1- i)))) "Other") ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 26, 2011 Share Posted May 26, 2011 Actually, this would make a lot more sense... (defun _toVisibilityState (obj visibilityState) (if (minusp (vlax-get obj 'IsDynamicBlock)) (vl-some '(lambda (x) (if (wcmatch (strcase (vla-get-PropertyName x)) "*VISIBILITY*") (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-value (list x visibilityState)))) ) ) (vlax-invoke obj 'GetDynamicBlockProperties) ) ) ) (defun c:Other (/ ss i o) (if (setq ss (ssget "_:L" '((0 . "INSERT") (2 . "`*U*,Connector")))) (repeat (setq i (sslength ss)) (if (eq (if (vlax-property-available-p (setq o (vlax-ename->vla-object (ssname ss (setq i (1- i))))) 'EffectiveName ) (vla-get-effectivename o) (vla-get-name o) ) "Connector" ) (_toVisibilityState o "Other") ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
qball Posted May 26, 2011 Share Posted May 26, 2011 I use the Properties pallette for mass changes to Dynamic Blocks or Attributes. Maybe I'm not understanding what you're actually trying to do. Quote Link to comment Share on other sites More sharing options...
resullins Posted May 27, 2011 Author Share Posted May 27, 2011 As do I. But there are two steps currently, and there only needs to be one. Mostly because my boss HATES the properties pallete. So if I can make this thing work without having the click in 18 places, it would be awesome, cause then my boss wouldn't get annoyed. @alan: Thanks for that!!!! I'll try it out later today... unfortunately, my morning is filled with fixing Engineer #3's shoddy work. I really hate Engineer #3. Quote Link to comment Share on other sites More sharing options...
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.