Author Topic: CAD Setup Routine  (Read 61750 times)

0 Members and 2 Guests are viewing this topic.

amgirard2003

  • Guest
CAD Setup Routine
« on: January 20, 2004, 02:53:48 PM »
Hey Everyone, :)

I'm looking at creating a setup routine..
I'm looking for some advice and somethings that i should keep
in mind when working on this..
Any comments would be greatly appreciated..

Thanks,
Andre

P.S-- I'm using Autolisp, I know a lot of Vlisp gets thrown around here..

Craig

  • Guest
CAD Setup Routine
« Reply #1 on: January 20, 2004, 03:02:43 PM »
Setup routine for a new drawing? If thats the case I would incorporate:
Commonly used layers, linetypes, styles (fonts, dims, etc..)
Is that what you were asking? :?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
CAD Setup Routine
« Reply #2 on: January 20, 2004, 03:02:55 PM »
Ok, lets think about what you want in a setup routine, nevermind what language it will be written in, you should decide that based on what you need and want to do.

Come up with what we liek to call pseudo-code

..
do this
do that
do the other thing
and don't forget to do this too
..

Once you kow what you want to accomplish, write bits of code to do each one individually, then put them together to form one command.

Answer these questions too...
Do you need/want it to run automatically ... on the first drawing opened? on all drawings opened?
Do you want to run it manually?
Should the user be notified or should it be transparent?

I am sure there are many other questions you need to answer but these will get you started in the right direction.

once you get a little clearer idea come back and lets discuss it a bit.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

amgirard2003

  • Guest
CAD Setup Routine
« Reply #3 on: January 21, 2004, 10:04:02 AM »
O.k i'll give you all the run down...
But first i should let you all know that i'm still a newbie when it comes to writting Lisp... I've written one routine so far....
I think working on a routine like this will give me a broader view on coding and overall concepts of Lisp programming.
I want to take one thing at a time and i know this will be quite painful as well, All i ask, if anyone is willing to help me out is for some patience..
I'm open and willing to learn... :)

Here's the run down as to what i want to happen..

When Autocad is launched it sets up as it always does..
The routine i want will be command driven.. such as (CADSTART or CADSETUP).

Once the command is entered i would like the following to happen..

-A menu pulldown will be loaded.
I want a menu pulldown to load only when the command is invoked.. Once invoked the menu will load commands that i would like to create in the future.

-A list of layers will be created with it's following characteristics.
Speaks for itself.

-Special Fonts will be loaded with Slides to pick from.
A command that i will place in the menu that will launch a slide of all the available custom fonts. Once the user selects the slide, the text command begins.

-A slide of details will be loaded..
same as above but will only work in PS mode... If launched within model space mode a message will be displayed telling the user that it will not work in model space and then will flip to paper space.

-The user will be prompt to enter a scale for which they want it to print in PS mode.
When the user enters a scale of 1"=20'-0", i want to have all text, linetypes and details to reflect that scale in PS mode

-A list of layout pages will be loaded.
Command will be put into the menu pulldown and when selected a slide will be displayed showing all available layouts ( Construction , Subdivision, Conversion) and so on..

Any input would be great...

Thanks,
Andre


 :D

deegeecees

  • Guest
CAD Setup Routine
« Reply #4 on: January 21, 2004, 10:30:33 AM »
Whoa, slow down there cowboy!

Thats quite a list of things to do. I will say that its alot to teach someone who has just started out in the world of Lisp and such. But, I will also say that, although (we) won't write all that code for you, (we) will point you in the right direction if asked nicely. I guess I can start you out on this first task...

(WE) need to look at is how this is all going to be loaded and when into memory. Now, as in most cases there are 2 or 3 right ways, and a million other ways. I would take a look at what version of AutoCAD you are using first.

After (we) attain this bit of info, we can proceed accordingly. :D

amgirard2003

  • Guest
CAD Setup Routine
« Reply #5 on: January 21, 2004, 10:40:16 AM »
I know it's a lot but i think i can handle it..
I think one piece of the puzzle at a time and things will go pretty well..
I know and understand that there will be bumps in the road but i won't be giving up on learning this..

I have 2 books...
Autolisp in Plain English by George O. Head... old version of the book
AutoCadet's guide to Visual Lisp by Bill Kramer (This book is confusing)


I'm using AutocadMap 5 so that would be AutoCad 2001

deegeecees

  • Guest
CAD Setup Routine
« Reply #6 on: January 21, 2004, 10:47:29 AM »
Ahhh... Good ol' Gearge O. Head. He was my first book on AutoLisp too.

OK, we're off to a good start...

Now, take a look at your HELP pull-down. There should be a "Developers Help" section. This will be your savior when it comes to finding out how to do things. If you do a little research you will find that the ACAD2000DOC.LSP is loaded into memory when you first start AutoCAD. This will be the preferred method of doing things in this application. Find your acad2000doc.lsp on your computer and open it up. Do not modify this file at this point.

I need to know if you are going to be sharing these routines with other users.

We will continue after this information is attained.

amgirard2003

  • Guest
CAD Setup Routine
« Reply #7 on: January 21, 2004, 10:58:02 AM »
O.k i've found the file...
I'm currently not gonna share the file with anyone else but in the future i will be..

George O. Head book is a good book and it's somethin i always refer too for refreshing my mind with some of the basics until it finally engraves itself into my mind.
The other book is too complex... goes into too much details and assumes you've had experience with LISP..

So it was refreshing to find this site...

deegeecees

  • Guest
CAD Setup Routine
« Reply #8 on: January 21, 2004, 11:06:31 AM »
OK, with the acad2000doc.lsp file open, do a "saveas" and create a new directory on your C:\ drive. Lets call it "acad_start" for the sake of continutiy. save this acad2000doc.lsp in this directory.

With AutoCAD open, right click on your command line and click on "Options". Go to the support directory section and "Add" the new directory to your list.

Next, move the newly added "acad_start" directory to the top.

What this will achieve is that AutoCAD will find the acad2000doc.lsp file that we are about to modify in the first directory in the support list and stop looking for it. This way all modifications will stay local to your machine and you can always go back to your "Vanilla" AutoCAD state if you need to.

After you accomplish this, we'll move on.

amgirard2003

  • Guest
CAD Setup Routine
« Reply #9 on: January 21, 2004, 11:19:06 AM »
O.k...I've created a new folder and the Acad2000doc.lsp is saved in that folder. I've gone into the options and added a new search path under support and moved it to the top...

I await further instructions

deegeecees

  • Guest
CAD Setup Routine
« Reply #10 on: January 21, 2004, 11:37:00 AM »
Ok, what I've set up for you here is a prerequisite to loading either VLisp, or VBA programs that will function as described in you post above. Your functions you described (if I am correct here) will activate when a command is called. This routine (command) will be loaded everytime you start a new drawing or open one up. To do this you need to set the "acadlspasdoc" variable to 1. We will do this in the acad2000doc.lsp file to ensure this.

In the acad2000doc.lsp file, append this to the END of the file:

;;;;;;;;;;;;;;;;Startup Functions;;;;;;;;;;;;;;;
(setvar "acadlspasdoc" 1)

deegeecees

  • Guest
CAD Setup Routine
« Reply #11 on: January 21, 2004, 11:42:36 AM »
Now, we need to create the functions. Lets tackle the outline of the achieved result here. I need to know EXACTLY what you are trying to do. Not just a generalization, give me every aspect of it.

If you could give me a detailed explanation (a bit more than previously posted) I can point you in a more detailed rather than general direction.

After this is achieved we will proceed, take your time.


(for anyone else out there reading this post, your input would be appreciated at this point) :D

amgirard2003

  • Guest
CAD Setup Routine
« Reply #12 on: January 21, 2004, 11:52:09 AM »
Quick question for ya..

I looked up "Acadlspasdoc" in the help section to read what it's purpose was..

Help says:
"Specifies whether acad.lsp is loaded at startup or with each drawing."

If set to true:-is loaded with each drawing
If set to False:- is loaded with the first drawing at startup

Default setting is set to True

My question is If the default is set to 1 which i assume is true then
why enter this to the end of the file?

deegeecees

  • Guest
CAD Setup Routine
« Reply #13 on: January 21, 2004, 11:56:51 AM »
It's been my experience that other users will mess around with settings. This is just a safe guard to protect against this. This is why I asked the multi-user question. Whe you do finally get this thing on its feet and have multi-user functionality, you will thank me. :D

amgirard2003

  • Guest
CAD Setup Routine
« Reply #14 on: January 21, 2004, 12:08:21 PM »
What i'm trying to do is speed up and standardize the drawings i work with.
Where i work we have 4 drafters and 4 people that do things differently..
Standards are not met within all 4 of us here.. It's very frustrating to work like this and me being the only one of the 4 willing to learn Lisp know there's a way to standardize the basics..

The basics involve :- Layers, Fonts, Linetypes, Layouts, details, scaling etc.

Layers:- When the command is launched all the layers that we use will be automatically loaded with their corresponding characteristics.

Fonts:- Most used fonts will be loaded and set as far as Height and so on and will be available to be selected through a slide for easy selection.

Linetypes:- Custom linetypes will be loaded as well

Details:- same use as the fonts

any questions??? feel free to ask.. i'll try an elaborate some more