Author Topic: DB Inserting  (Read 3124 times)

0 Members and 1 Guest are viewing this topic.

Luke

  • Guest
DB Inserting
« on: February 27, 2008, 05:04:16 PM »
I've created these attached DB's.

Can anybody tell me how to change...
1) the default visibility state they insert at.
2) the default lookup property they insert at.

I am inserting using a pulldown menu with the following macro(s)... ^C^C-insert;LCC_XXXX;sc;1;r;0;
Change XXXX accordingly


whdjr

  • Guest
Re: DB Inserting
« Reply #1 on: February 27, 2008, 06:06:51 PM »
Inserting from a pull-down menu is the same as inserting from a toolbar in which case I don't believe you can change the properties of the block before you insert it.

However if you were inclined to insert from the tool palettes then you would have that option.  I don't know of another way.

Sorry  :-(

Luke

  • Guest
Re: DB Inserting
« Reply #2 on: February 27, 2008, 06:19:18 PM »
Any idea how to control which visibility state is selected on insert?  I don't want to be able to choose or change it every time, I just want to make a different one active than how it is currently coming in...

Birdy

  • Guest
Re: DB Inserting
« Reply #3 on: February 27, 2008, 06:41:41 PM »
Luke, I gotta agree with Will.
Inserting from a Tool Palette will do what you want.
Right click-properties and look for the visibility state to insert at.
Otherwise........:(

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: DB Inserting
« Reply #4 on: February 28, 2008, 07:29:33 AM »
I believe you would have to roll your own type of insert for that.

Insert
Grab insert
Change that insert
Exit

Then just run your custom insert from the pull down.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright 2016

Luke

  • Guest
Re: DB Inserting
« Reply #5 on: February 28, 2008, 08:00:18 AM »
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.

whdjr

  • Guest
Re: DB Inserting
« Reply #6 on: February 28, 2008, 08:43:20 AM »
You do realize the tool palettes can be set to come out and then retract when done don't you?

Guest

  • Guest
Re: DB Inserting
« Reply #7 on: February 28, 2008, 08:58:17 AM »
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).

Code: [Select]
;;;=================================================================================================
;;; 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...

Code: [Select]
^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...

Code: [Select]
^C^C^P(load "Blocks.lsp");(Dynamic_Block_SetProperty "YourDir" "Your Block Name" "Visibility" "Visibility State Name" "Your Attribute Value");

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: DB Inserting
« Reply #8 on: February 28, 2008, 12:44:05 PM »
Yeah!  What Matt said.


Thanks Matt.   :-P
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright 2016

Luke

  • Guest
Re: DB Inserting
« Reply #9 on: February 29, 2008, 11:06:11 AM »
OK so you talked me into it.  I'm going to insert through the tool pallet.  However this block is not working for me and I've rebuilt it several times.  Can anybody help me figure it out.

When I insert the block through the standard insert command visibility and lookup values all function as I intended.  When I insert it through the tool pallet with the Lookup Value Property set to any scale other than 12" = 1' the attributes come in all out of wack.  Not quite sure why or how to fix.