Tim,
Not sure what you mean by "roll own type of insert"??
I'd love to use tool pallets but just not realistic. My guys complain now about how little drawing area they haave due to small monitors and excess toolbars.
Are you aware that you change the appearance of the tool palettes to mimick a toolbar (sort of) by changing the view of the palette? (see image below).
As for Tim's comment, he means you'd have to create a custom insert routine to change the vis state on the fly (or you can just use this).
;;;=================================================================================================
;;; Function: DYNAMIC_BLOCK_SETPROPERTY
;;;
;;; Description: Inserts a dynamic block, changes a specified property
;;; and automatically highlights it to enable dynamic grips
;;;=================================================================================================
(defun DYNAMIC_BLOCK_SETPROPERTY (strBlockPath strBlockName strPropName strPropValue strAtt /
lista lts pickset1 insPT objLast)
(setvar "attdia" 0)
(setq insPT (getpoint "\n Pick insertion point..."))
(setq lts (getvar "ltscale"))
(if (= strAtt "")
(progn
(if (= (tblsearch "block" strBlockName) nil)
(command "-insert" (strcat strBlockPath strBlockName) insPT lts lts "")
(command "-insert" strBlockName insPT lts lts "")
)
)
(progn
(if (= (tblsearch "block" strBlockName) nil)
(command "-insert" (strcat strBlockPath strBlockName) insPT lts lts "" (strcase strAtt))
(command "-insert" strBlockName insPT lts lts "" (strcase strAtt))
)
)
)
(setq objLast (entlast))
(setq obj (if (= (type objLast) 'vla-object) objLast (vlax-ename->vla-object objLast)))
(if (= (vlax-get-property obj 'isdynamicblock) :vlax-true)
(progn
(setq v (vla-getdynamicblockproperties obj)
vval (vlax-variant-value v)
sal (vlax-safearray->list vval)
tot (length sal)
i 0
)
(while (< i tot)
(if (= (vlax-get-property (nth i sal) "PropertyName") strPropName)
(progn
(vlax-put-property (nth i sal) "Value" strPropValue)
(setq i tot)
)
(setq i (1+ i))
)
)
)
)
(setq pickset1 (ssadd))
(ssadd objLast pickset1)
(sssetfirst nil pickset1)
(princ)
)
And the code behind the button would look something like this...
^C^C^P(load "Blocks.lsp");(Dynamic_Block_SetProperty "YourDir" "Your Block Name" "Visibility" "Visibility State Name" "");
And if the DB you are inserting has attributes and you want to auto-magically fill in the value...
^C^C^P(load "Blocks.lsp");(Dynamic_Block_SetProperty "YourDir" "Your Block Name" "Visibility" "Visibility State Name" "Your Attribute Value");