Author Topic: Need Help when inserting block from Design Centre  (Read 5912 times)

0 Members and 1 Guest are viewing this topic.

abcstocks

  • Guest
Need Help when inserting block from Design Centre
« on: July 28, 2006, 01:06:02 PM »
I am trying to modify couple of things in Design Centre as I am creating a furniture library...

1st is background color of Design centre to black as yellow color from the dwgs doesn't display properly, but I found out that changing design centre background color is not possible from spaug.org website.

2nd is I want to modify insertion procedure of drawing from design centre..

Right now, when you drag a block from design centre to current drawing it ask for insertion point and then other parameters like X and Y scales and rotation angle, what I am trying to do is when you insert a block from design centre it will only ask for insertion point not any other parameters. I changed in CUI file - insert block command to short the steps and it is working if I use .INSERT command on command line but when I use Design centre to insert a drawing it goes back to original all steps..I am doubtful that there is a hidden command named  Command: acdcinsertblock but its not documented...Can you please help me with this issue..
for AutoCAD 14 .. I have created a variable named BSCL and included in ACAD.LSP it determines from measurement variable that if dwg is imperial then set value of BSCL to 1 or else 25.4 for metric. and I was using this values ith getpoint variable to short the procedure of insertion in CAD version 14.

(if (= (getvar "measurement") 1)
   (setq bscl 25.4)
   (setq bscl 1.0)
);end if
(command ".insert" "c:/lib/dwgid" inspt bscl bscl "" dwgid date req name)

Arizona

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #1 on: July 28, 2006, 05:57:30 PM »
My first instinct is that you would have a lot more flexibility to do what you are trying to do using a menu system instead of the design center.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need Help when inserting block from Design Centre
« Reply #2 on: July 28, 2006, 06:04:15 PM »
The command name (at least on my computer, 2006) for dragging in a block from the design center is "DROPGEOM".  Here is the code I used to see what it did.
Code: [Select]
(if (not GlbReactorCommandEnded)
 (setq GlbReactorCommandEnded (vlr-command-reactor "InsertReactor" '((:vlr-commandEnded . "InsertCommandReactor"))))
)
(defun InsertCommandReactor (React Lst)
(print React)
(print Lst)
)

Once this is loaded into a draiwng, it will print the name of every command used, until closed and opened again.

Edit:
  I only got prompted for insertion point.  My company sets up my system variables, and I don't use the design center, so I couldn't tell you why it works like this one my setup.
« Last Edit: July 28, 2006, 06:05:48 PM by T.Willey »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

abcstocks

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #3 on: July 31, 2006, 01:13:49 PM »
Thanks for ur replies, I want to use design centre and when inserting block (drag and drop from design centre ) wish that only insertion point will be asked. :-(

abcstocks

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #4 on: July 31, 2006, 01:18:15 PM »
Its me again, If I cant make insertion working with design centre how else can I create furniture library using menu, slides ? Can some one share in depth knowledge on this ? Thanks in advance

Arizona

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #5 on: July 31, 2006, 03:44:31 PM »
Do you need/desire pictures?
Otherwise a good menuing system depends on good planning.
In other words, classify and group items in a logical manner (and put a lot of thought into this). Set up a directory structure for your blocks. Once complete, minimize access to this area. Utilize one common (partial) menu and point the users to that menu. This makes maintenance and updates easier to do. Do updates and maintenance!

LE

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #6 on: July 31, 2006, 04:01:26 PM »
You can use the routine from over here:

http://www.theswamp.org/index.php?topic=9441.msg132789#msg132789

Then, where reads something like:

Quote
(vla-sendCommand thisDwg "_.-insert \n")

Do your own version of insert parameters in the send command function.

HTH.

abcstocks

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #7 on: August 01, 2006, 10:37:19 AM »
Thanks for all your help but frankly I have very little or no knowledge of LISP compare to yours..I tried to modify ur program but couldnt use as you advised. Thanks for your help.

(p.s. can I override default ".-insert" command so it will not ask me scale and rotation when I insert dwg from design centre ? Tks)

sinc

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #8 on: August 01, 2006, 08:19:43 PM »
If your version of Autocad has Tool Palettes, I highly suggest you check into them.  It sounds like they will serve your purposes much better than the other routes you are exploring.
« Last Edit: August 02, 2006, 11:52:57 AM by sinc »

LE

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #9 on: August 02, 2006, 12:11:02 AM »
Thanks for all your help but frankly I have very little or no knowledge of LISP compare to yours..I tried to modify ur program but couldnt use as you advised. Thanks for your help.

(p.s. can I override default ".-insert" command so it will not ask me scale and rotation when I insert dwg from design centre ? Tks)

Here is, please run some tests, and see if that is what you are looking for.

HTH

Code: [Select]
(vl-load-com)

(if (not thisDwg)
  (setq thisDwg (vla-get-activedocument (vlax-get-acad-object))))

(defun callback-commandEnded  (reactor params / bName)

  (if (and
:obj
(eq (type :obj) 'vla-object)
(not (vlax-erased-p :obj)))
    (progn
      (vla-put-visible :obj :vlax-true)
      (not (vl-catch-all-error-p
     (vl-catch-all-apply 'vla-delete (list :obj))))
      (setq :obj nil)))

  (if (wcmatch (car params) "DROPGEOM,EXECUTETOOL")
    (progn
      (setq :obj (vlax-ename->vla-object (entlast)))
      (setq bName (vla-get-name :obj))
      (setvar "insname" bName)
      (vla-put-visible :obj :vlax-false)

      ;; insert command
      (vla-sendCommand
thisDwg
"_.-insert \nScale\n1\nRotate\n0\n") ;; here replace the scalefactor 1 and rotation 0 as required

      )))

(defun C:ON-INSERT  ()
  (if (not :drop_geometry_reactor)
    (setq :drop_geometry_reactor
   (vlr-editor-reactor
     "droping-geometry-editor-reactor"
     '
      ((:vlr-commandEnded . callback-commandEnded)))))
  (prompt "\nInsert feature enabled. \n")
  (princ))

(defun C:OFF-INSERT  ()
  (if :drop_geometry_reactor
    (progn
      (if (vlr-added-p :drop_geometry_reactor)
(vlr-remove :drop_geometry_reactor))
      (setq :drop_geometry_reactor nil)
      (prompt "\nInsert feature disabled. \n")
      ))
  (princ))

(princ)

abcstocks

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #10 on: August 02, 2006, 12:32:09 PM »
Thanks LE for posting code, I loaded LISP routine in 2006 then invoke command ON-INSERT and it gave message "Insert feature enabled" but still when I drag and drop a file from DS it is still asking to selelct insertion point then scales and rotation.

I dont want to use Tool Pelletes Bse I have read somewhere that Tool Pelletes required to be recreated when you upgrade CAD version.


 Tks LE for you help I really appreciate

sinc

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #11 on: August 02, 2006, 04:31:43 PM »

I dont want to use Tool Pelletes Bse I have read somewhere that Tool Pelletes required to be recreated when you upgrade CAD version.


Do you know where you heard that?  I don't remember having any issues with Tool Palettes when I moved from 2006 to 2007.  I didn't have as many as I have now, but I don't think I had to do anything special.

LE

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #12 on: August 02, 2006, 04:40:32 PM »
Quick question Sinc;

Can you setup globally a set of blocks - let say to use a particular default scale factor, now in versions 2006 & 2007? or you have to go to one at the time?

Thanks.

sinc

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #13 on: August 02, 2006, 05:02:32 PM »

Can you setup globally a set of blocks - let say to use a particular default scale factor, now in versions 2006 & 2007? or you have to go to one at the time?


I'm not really sure what you're asking...  Tool Palettes have two different scaling options, though, which can be used simultaneously.  The first is a selection box that can cause the block to be scaled either by the current DIMSCALE or by the plot scale of the current layout.  The other is just a multiplier, and you can enter any number for that.

This is a setting in the property of the tool, so you could conceivably have two block tools that insert the same block in two different ways.

LE

  • Guest
Re: Need Help when inserting block from Design Centre
« Reply #14 on: August 02, 2006, 05:10:18 PM »
Thanks I know about that, let me try again.... in the properties dialog for each item at the toolpallete, there are the Scale and Auxiliary Scale (what you mentioned), my question is, if it is possible now in version 2006 or 2007, to globally setup any of those values (for all the items blocks in the toolpalette) to let say DIMSCALE or a factor 4.0....

(sorry my English level is bad)

Thanks.