Author Topic: arrowheads insertion routine  (Read 6815 times)

0 Members and 1 Guest are viewing this topic.

t-bear

  • Guest
arrowheads insertion routine
« Reply #15 on: November 15, 2004, 08:33:50 AM »
's'ok ... gonna play a while.  Then I got a new vict.... DRAFTER ('scuse me) to start training this morning.  what a way to screw up a monday......

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
arrowheads insertion routine
« Reply #16 on: November 15, 2004, 09:00:21 AM »
David,
I like your block test/insert code very much.
Thanks
CAB
Code: [Select]
 (while (or (not arw_blk)
             (not (snvalid arw_blk))
             (not (or (tblsearch "BLOCK" arw_blk)
                      (findfile (strcat arw_blk ".DWG"))
                  )
             )
         )
    (setq arw_blk (getstring "\nArrow Block Name:   "))
  )

  (if (not (tblsearch "BLOCK" arw_blk))
    (progn (command "_.INSERT" arw_blk); start the insert
           (command); cancel insert, but block is created in databse
    )
  )
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.

David Bethel

  • Swamp Rat
  • Posts: 656
arrowheads insertion routine
« Reply #17 on: November 15, 2004, 11:00:42 AM »
Cab,

I have a bunch of those kinds of snippets.  Here is 1 I use a real regular basis so that no external blocks are required.  -David

Code: [Select]
(defun SetBlk (n)
  (and (not (tblsearch "BLOCK" n))
       (eval (list (read n)))))

(defun arr ()
(entmake '((0 . "BLOCK") (2 . "ARR")(70 . 0)(10 0 0 0)))
(entmake '((0 . "POLYLINE")(8 . "0")(66 . 1)(10 0 0 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 -12 0 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 0 0 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 -8 8 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 8 0 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 -8 -8 0)))
(entmake '((0 . "VERTEX")(8 . "0")(10 0 0 0)))
(entmake '((0 . "SEQEND")(8 . "0")))
(entmake '((0 . "ENDBLK"))))

(SetBlk "ARR")
R12 Dos - A2K

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
arrowheads insertion routine
« Reply #18 on: November 15, 2004, 11:44:43 AM »
Hay that's great, thanks.
I have noticed in ACAD2k+ the acad standard blocks for leaders are not in a dwg file.
They are created on the fly when you use a leader with that type of block.
And with the name _DotMed I had trouble creating them myself. So i was trying to figure
a way to force acad to create them.
I see from your other code that I might have to create a leader using the command line
and then delete the leader with the block being retained in the drawing.
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.