Author Topic: Another Insert Block thread  (Read 2139 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
Another Insert Block thread
« on: December 13, 2012, 04:03:36 PM »
Hi all, I have been trolling the net for the better part of an hour looking for something spacific.  I found and "saved" many of the wonderful block insert code I have come across, but most are not quite or more than I need.  I have code that will insert a drawing the escape before placeing the drawing then removeing the block.dwg and some with dialog boxes etc...

Basicaly all I am looking for is to do this.
I have a drawing that I keep Architect and Engineering seals in, by state, each state has more than one block for each Arch/Eng seal, I want to insert a spacific seal from a spacific file.

If I where to put it in laymen terms:  (command "_.-insert" "C:\\Path\\DrawingName.dwg" "BlockName")
That's it.

I don't write code often enough and forget more than I learn but if someone can give me a starting point you will save me hours/days of stress.


Thanks

cadman6735

  • Guest
Re: Another Insert Block thread
« Reply #1 on: December 13, 2012, 04:48:41 PM »
« Last Edit: December 13, 2012, 04:54:42 PM by cadman6735 »

cadman6735

  • Guest
Re: Another Insert Block thread
« Reply #2 on: December 13, 2012, 05:27:38 PM »
Here is something that I pieced together, more simple and more what I was looking for, which I can expand upon...

Code: [Select]
(defun Arkansas ( / )

  (command "_.-insert" "C:\\Path\\Seals\\Arkansas.dwg" nil)   ;Seal Path
  (command "_.-purge" "Block" "Arkansas" "No")                    ;Purges Arkansas.dwg

  (command "ddinsert" Pause "")                                           ;Opens insert dialog box for seal(block) selection and insertion

  (command "_.-purge" "Block" "*Arkansas*" "No")                ;Purges unused (Arkansas - Name1, Arkansas - Name2, Arkansas - Name3 using Arkansas as the *WildCard*
                                                                                          ;Placed seal remains
(princ)
)


Now I place a command on my tool palette for each state (why am I doing it this way vs more standard way, for some reason users find it hard to hit the refresh button on the tool palette that brings in new seals(block) at the very bottom out of alphabetical order and harder to find when there are 20+ seals and all the complaining)

anyway, till next time...
« Last Edit: December 13, 2012, 06:07:27 PM by cadman6735 »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Another Insert Block thread
« Reply #3 on: December 13, 2012, 06:09:12 PM »
Would either of these help at all?

Copy Block from Drawing
Steal from Drawing

Or have I misunderstood? (likely)

cadman6735

  • Guest
Re: Another Insert Block thread
« Reply #4 on: December 13, 2012, 06:21:40 PM »
Hi lee

no, I have already found your two wonderful lisp routines and "saved" them...  They are both more than I am looking for...  my simple little macro does exactly what I want, I just don't write lisp very often and find myself swimming in the relearning process.  Once I posted my question it allowed me to relax and figure it out.  Sometime just typing/posting a thought helps me figure out my own problem.  It's not fancy but works.

Thanks Lee

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Another Insert Block thread
« Reply #5 on: December 13, 2012, 06:24:00 PM »
Sometime just typing/posting a thought helps me figure out my own problem.  It's not fancy but works.

You need to buy yourself a rubber duck  :lol:

cadman6735

  • Guest
Re: Another Insert Block thread
« Reply #6 on: December 14, 2012, 09:17:07 AM »
Quote
You need to buy yourself a rubber duck 

I thought this is what forums are for, discussing and talking things out, I am old and I do talk to myself, so I could imagine what my co-workers would think if I started to talk to a rubber duck, I do find hummor in that thought.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Another Insert Block thread
« Reply #7 on: December 14, 2012, 10:22:39 AM »
Quote
You need to buy yourself a rubber duck 

I thought this is what forums are for, discussing and talking things out

'twas just a joke  :wink:

CADDOG

  • Newt
  • Posts: 82
  • wishbonesr
Re: Another Insert Block thread
« Reply #8 on: December 14, 2012, 05:08:02 PM »
No way!  That's the best idea ever!
I usually wait till everyone leaves the office before I start talking to myself about my code.  Gonna get me a duck, and have an excuse to talk out loud in my cubby during the day-time.
Be like, "What?....  I'm talking to Walter."

 :lmao:

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Another Insert Block thread
« Reply #9 on: December 15, 2012, 07:49:19 AM »
 :-D  :-D

BIGAL

  • Swamp Rat
  • Posts: 1410
  • 40 + years of using Autocad
Re: Another Insert Block thread
« Reply #10 on: December 20, 2012, 03:16:02 AM »
Maybe have a look into "palettes" for inserting common used blocks or like me older style menu picking and using slides. You can group and see an image to help picking.
A man who never made a mistake never made anything