Author Topic: Loading a block in the drawing without inserting it  (Read 6628 times)

0 Members and 1 Guest are viewing this topic.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Loading a block in the drawing without inserting it
« Reply #15 on: January 18, 2008, 02:45:16 PM »
Yea. I'm alright - thanks.  Stress and the monitor (not to mention the stuff used to relieve said stress) is taking a toll.  But - I'm getting close to never needing to be on a computer - ever.  (reason for said stress).

jb

James Buzbee
Windows 8

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Loading a block in the drawing without inserting it
« Reply #16 on: January 18, 2008, 03:08:09 PM »
Yea. I'm alright - thanks.  Stress and the monitor (not to mention the stuff used to relieve said stress) is taking a toll.  But - I'm getting close to never needing to be on a computer - ever.  (reason for said stress).

jb
I'm sure it will all work out for the best in the end, but until then I hope you can take some time a relax, and forget about the stress.  Good luck to you, and I hope one day to be there (never needing a computer) too.
Tim

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

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Loading a block in the drawing without inserting it
« Reply #17 on: January 18, 2008, 03:54:35 PM »
CAB :
Quote
It wasn't the block you want because you did not share that with us.
Well it smells like powder here , yet I'll add a frase from my initial post :
Quote
I need this in order to load an arrow block

OK, here is an example. I have a lisp that produces the core code by selecting the block in a drawing.
You then place this code in your ACADdoc.lsp file and when you open a drawing the block is created if
it doesn't exist.
Note, this is just an example, post a drawing with your arrowhead inserted in it & I will give you the code for it.
Code: [Select]
(defun eMakeArchTick ()
  (entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference")
  (2 . "_ArchTick") (10 0.0 0.0 0.0) (70 . 0)))
  (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (62 . 0) (100 . "AcDbPolyline")
  (90 . 2) (70 . 0) (43 . 0.15) (38 . 0.0) (39 . 0.0) (10 -0.5 -0.5) (40 . 0.15) (41 . 0.15)
  (42 . 0.0) (10 0.5 0.5) (40 . 0.15) (41 . 0.15) (42 . 0.0)))
  (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
  (princ)
)
(or (tblserch "BLOCK"  "_ArchTick") (eMakeArchTick)) ; make the block
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Re: Loading a block in the drawing without inserting it
« Reply #18 on: January 18, 2008, 04:06:38 PM »
Object DBX is very cool but also fickle.

That code you posted from Tony worked good, but i have an ``improved'' version i hacked together somewhere in my files. I will see if i can locate it if you would like.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Loading a block in the drawing without inserting it
« Reply #19 on: January 18, 2008, 04:57:09 PM »
Quote
Object DBX is very cool but also fickle.

I havn't had any problems at all.  My programs that use ObjectDBX:

Import Layers


Working States - reads Layer States in an external standards drawing to set active drawings layers


Import Views


Block Manager



Detail Manager


What types of problems have you had?  There are some limitations you have to be aware of.
James Buzbee
Windows 8

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Re: Loading a block in the drawing without inserting it
« Reply #20 on: January 18, 2008, 05:22:12 PM »
no problems, works great, continue on, have fun.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

iliekater

  • Guest
Re: Loading a block in the drawing without inserting it
« Reply #21 on: January 18, 2008, 05:34:21 PM »
Daron :
Quote
Insert it to the center of the screen and erase it
Yes , you are right . I thought about that back there but forgot to ask . You see inserting a block and erasing it will do the trick , but one cannot erase it by selecting it as the last object because it may not be visible . Therefor , is there a way to get the middle of the current view ?

jbuzbee , let me ask you something : how did you make those wonderful snapshots ? I use the PrintScreen and paste it on the Paint program , but I never manage to select correctly the margins of the dialog boxes ...

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Loading a block in the drawing without inserting it
« Reply #22 on: January 18, 2008, 05:39:56 PM »
You could use something like this:

(vla-delete (vlax-ename->vla-object (entlast)))


I'd use CAB's entmake method....

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Loading a block in the drawing without inserting it
« Reply #23 on: January 18, 2008, 05:59:59 PM »
iliekater:

I use photoshop - don't know about paint - but when you start a new file in photoshop it checks the clipboard for a default size . . . paste, done.
James Buzbee
Windows 8

daron

  • Guest
Re: Loading a block in the drawing without inserting it
« Reply #24 on: January 18, 2008, 06:10:27 PM »
Daron :
Quote
Insert it to the center of the screen and erase it
Therefor , is there a way to get the middle of the current view ?
Insert block with:
(getvar 'viewctr)
and then erase "last" shouldn't give a problem, unless the insertion point and the objects in the block are too far away from each other.

daron

  • Guest
Re: Loading a block in the drawing without inserting it
« Reply #25 on: January 18, 2008, 06:12:03 PM »
iliekater:

I use photoshop - don't know about paint - but when you start a new file in photoshop it checks the clipboard for a default size . . . paste, done.
GIMP's good at that too, if you can't afford PS.

iliekater

  • Guest
Re: Loading a block in the drawing without inserting it
« Reply #26 on: January 19, 2008, 12:34:46 PM »
Yes , Photoshop seems a good idea . First paste the whole picture , use the magic wand and then "select inverse" , cut and paste it on another file (which as jbuzbee said , is initialy made on the dimensions of the picture stored in the clipboard) . Thanks .

I am off to try what you said about erasing the last objects (entinities) .

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Loading a block in the drawing without inserting it
« Reply #27 on: January 19, 2008, 12:43:26 PM »
Off topic but in Paint Shop Pro one just pastes to new image. If the original screen capture is via <alt> <prtscn> poof | wallah -- no trimming required.

Of course there's always SnagIt if one's real lazy.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst