Author Topic: block file location  (Read 3157 times)

0 Members and 1 Guest are viewing this topic.

gatorcadd

  • Guest
block file location
« on: September 13, 2005, 10:49:22 AM »
i would like to write a macro for a block insertion from an outside file...like another directory...
i use the -insert command and dont know what to type to get out of the current directory

something like this?

-insert (c:\plants\symbols) \

someone very smart showed me how to do it, and i lost the macro...

i just want to know how to route the path for the directory and then select the dwg i want to insert.

oh yeah if it can pull up the dialogue box for that directory that would be cool.

any help would be apprecieated.  thanks
« Last Edit: September 13, 2005, 10:51:56 AM by gatorcadd »

ronjonp

  • Needs a day job
  • Posts: 7529
Re: block file location
« Reply #1 on: September 13, 2005, 11:07:45 AM »
You have to use forward slashes or double back slashes.

-insert c:/plants/symbols/myblock.dwg \

or

-insert c:\\plants\\symbols\\myblock.dwg \

you can redefine the block with:

-insert c:/plants/symbols/myblock=myblock.dwg \

I don't think you can have the dialogue popup or it will kill the macro.

You also might want to consider setting the layer before inserting.

-layer;make;mylayer;;-insert c:/plants/symbols/myblock.dwg \

HTH

Ron


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

deegeecees

  • Guest
Re: block file location
« Reply #2 on: September 13, 2005, 11:10:09 AM »
Try this:
Code: [Select]
(setq dfil (getfiled "Select A File" "p:/" "dwg" 0))
Change the "p:/" to your directory and use forward slashes, or double backslashes (i.e. c:\\mydocs\\dwgs\\, or c:/mydocs/dwgs/)

gatorcadd

  • Guest
Re: block file location
« Reply #3 on: September 13, 2005, 11:11:46 AM »
That looks like the ticket, but how do i select the right block if there are more in the directory...that is why i wanted to ddl to come up.

this will work, i appreciate the help..

ELOQUINTET

  • Guest
Re: block file location
« Reply #4 on: September 13, 2005, 11:14:07 AM »
gator what version of cad are you using. we use a combonation of palettes and slide menus here. are you familiar with blockwerx? if you use it you will see an image of what's in the file. ummm why do you have files with the same name, kind of counter productive dont ya think?

gatorcadd

  • Guest
Re: block file location
« Reply #5 on: September 13, 2005, 11:24:02 AM »
both of those work the way i need them, now onto the next question

i want to load a lisp from a macro the same way, but again dont know how to do it unless i use appload.  and then the dialogue loads and i dont want to do that.

i know where the lisp file is, i just dont know how to route to it.  is it the same as above?  dont i need some parenthesis?

keep going, i dont have many more questions, i will keep it short.

we use r2k4.

deegeecees

  • Guest
Re: block file location
« Reply #6 on: September 13, 2005, 11:32:33 AM »
Try this:

(load"mylispfile")

Change the "mylispfile" to you choosing.

If your support paths point to the directory that your lisp file is in, it will load without having to type the path in.

To add a support path:
-From the command line type-------->options
-Pick the "Files" tab
-Expand "Support Files Search Path"
-Select "Add", and then "Browse"
-Navigate to your directory, and select OK
-Close out tyhe Options dialog

ELOQUINTET

  • Guest
Re: block file location
« Reply #7 on: September 13, 2005, 12:08:10 PM »
or you could open up your acad2004doc.lsp file in program files acad 2004/support
then do a find and type autoload and add your lisps
then go to your startup suite and add this file and your done
this will only load them when needed and will also load them if the command is typed in.

heres a snippet from mine:


(autoload "tutorial" '("tutdemo" "tutclear"
                   "tutdemo"
                   "tutclear"))
;;; ===== Mylisps =====<<<<<<<<<add a section for your lisps

(autoload "C:/0_LISP_FILES/the lisp it calls put here.LSP" '("whatever your alias is put here"))
(autoload "C:/0_LISP_FILES/ADDNUMB.LSP" '("ADDNUMB"))
(autoload "C:/0_LISP_FILES/ARW.LSP" '("ARW"))
(autoload "C:/0_LISP_FILES/ATTNUMB.LSP" '("ATTNUMB"))
(autoload "C:/0_LISP_FILES/BAP.lsp" '("BAP"))
(autoload "C:/0_LISP_FILES/BB.lsp" '("BB"))
(autoload "C:/0_LISP_FILES/BDI.lsp" '("BDI"))
(autoload "C:/0_LISP_FILES/BKH.lsp" '("BKH"))
(autoload "C:/0_LISP_FILES/BL.lsp" '("BL"))
(autoload "C:/0_LISP_FILES/BLKSWP.lsp" '("BLKSWP"))
(autoload "C:/0_LISP_FILES/BLOCKING.LSP" '("BLOCKING"))
(autoload "C:/0_LISP_FILES/BRCH.LSP" '("BRCH"))

gatorcadd

  • Guest
Re: block file location
« Reply #8 on: September 14, 2005, 03:51:01 PM »
i guess i am not understanding how to get the path routed and them the ddl to open to show me what is in the folder.   :realmad:

i was hoping it was like a set path or set environment thingy that i put in and routed to the directory and then ran the insert command...

my blocks will be in one directory,  but i want to be able to scroll to the one i want and select it in the ddl and then have it insert it...

this would be cool for me in a macro, but a lisp would suffice, and i could use the lisp in another thing i am doing...

(see my previous post) :cry:


Andrea

  • Water Moccasin
  • Posts: 2372
Re: block file location
« Reply #9 on: September 15, 2005, 09:02:47 PM »
drag and drop your lisp in your suitcase....when making APPLOAD..
this will load each time your lisp.
Keep smile...