|
ACAD Newsletter Vol 05 No 06
|
jos vandoorn
|
Mar 16, 2005 17:32 PST
|
-------------------ACAD newsletter---------------------
Newsletter about AutoCAD and AutoLISP
-------------------------------------------------------
Vol 05, No 06 March 2005
-------------------------------------------------------
-------------------------------------------------------
For best viewing maximize the window to full size
-------------------------------------------------------
In this issue I have prepared for you....
1. Top Sponsor Section
2. Notes from the Publisher
3. Hatch 1
4. Privacy Policy, Legal Stuff and Advertising Info.
5. Contact Information
*******************************************************
*******************************************************
*******************************************************
-------------------------------------------------------
1. Top Sponsor Section
-------------------------------------------------------
My client wrote me this ...
Dear AutoCAD user,
Speeding up AutoCAD. That's my business. I do a lot of
that thing. And I only have happy customers. This is an
e-mail I received.
Dear Jos,
Thank you very much for helping me with AutoCAD.
AutoCAD was a real burden. It was costing me a
lot of time and money.
No more. Thanks to you. Now I get my AutoCAD
drawings right away. I don't have to check them.
And anybody can make them.
We had to make an investment to engage you. But
the investment was well worth it. It was only a
small portion of what was brought back.
Thanks again.
Go ahead. Think it over. See whether you want to engage
me. Maybe you want to keep on wasting time and money on
AutoCAD for a long while.
If you want me to help you, then send an e-mail to:
mailto:acadprog-@hotmail.com
Write "Client" in the subject line. Or even quicker.
Give me a call. In Malaysia. This is my number:
012-9312742
Sincerely,
Jos van Doorn. AutoCAD specialist and AutoLISP
programmer. Also publisher ACAD Newsletter. About
AutoCAD and AutoLISP. FREE. To subscribe send a blank
e-mail to:
mailto:acadnewslett-@hotmail.com
P.S. I found your e-mail address in the paper. You
were looking for an AutoCAD man. After I help
you, you don't need that AutoCAD man.
P.P.S. I work on a "no cure, no pay" base. If you
don't save you time and money, then I'll work
at no charge.
*******************************************************
*******************************************************
*******************************************************
-------------------------------------------------------
2. Notes from the Publisher
-------------------------------------------------------
Multiple Eye Color
That's what I have. Multiple eye color. I found out the
other day. In the supermarket. Kila was there. Not
behind the cashier.
I called her name. I looked at her. And I pointed my
eyes in the direction of the cashier. But Kila wasn't
moving.
"Look at my eyes", I told Kila. Still. Kila didn't make
a move. "I know", I said, "you don't want to look at my
blue eyes".
"You have no blue eyes", Kila said. How could she say
that? Did I make her upset? I turned to Emmy. "Kila
says I didn't have blue eyes".
"You have", Emmy said. "You see", I said to Kila. "I
asked Emmy. And she says that I have blue eyes. So my
eyes are blue".
"You know", I said to Kila, "my eyes have multiple
color. If you talk nice to me, then they are blue.
Otherwise they are not blue".
Kila was saying that my eyes are not blue. Now that's
not nice. So the col9or of my eyes changed from blue to
another girl.
I asked Emmy. Emmy said that my eyes are blue. Now that
is nice. So right away my eyes were blue. Multiple
color eyes. You know.
The other day I was again in the supermarket. Kila saw
me. "Hi, Mr. Blue Eyes", she said. "You see", I said to
her, "you talk nice and my eyes are blue".
AutoCAD 2005
I've written two books about AutoCAD 2005. The first
books is a base course. The second book is an advanced
course. My God.
Autodesk sure put in a lot of effort to make a bad CAD
program. What a mesh. There are many ways to do a
simple thing.
Plot configuration files. We had PCP files and PC2
files. Now we also have PC3 files. Next version of
AutoCAD. PC4 files?
We've got template files. But there is a also a page
setup option. And a plotter manager. And a plot style
manager. Why is that?
I've been working with AutoCAD since version 10. There
were a lot of changes in all the versions that came
later. Now we have AutoCAD 2005.
The best version of AutoCAD was AutoCAD 14. That
version was pretty clear. And most things you could
only do in one way.
Another problem with AutoCAD. But they have that
problem since version 2.6. I believe. The Help files.
How bad they are.
AutoCAD 2005. If you want to find something. Forget it.
Most of the time you've got a load of information. And
you cannot find what you're looking for.
That's what I found. A lot of information about the
program cannot be found in the Help files. It just
isn't there.
I know why we have all the changes all the time.
Autodesk wants to sell the program over and over again.
That's why.
I feel that Autodesk must change their altitude. Don't
think solely about selling the AutoCAD program. Also
think about giving customer support.
There are alternatives for AutoCAD. I know these
alternatives. These alternatives are much better. And
much cheaper.
Where are you from?
That's a question I hear every day. When I go out. Not
once. No. At least three times. The Malays are very
boring.
I'm not sure. But that must be. They teach it to the
children in school. "If you see a foreigner, then ask
where he is from".
I've been in Malaysia more than ten years. And still
they are asking me every day where I'm from. If I go
out. In the street.
Look. I'm a very tall Westerner. Almost two meters. I
don't look like a Malay. So it's very clear that I'm a
Westerner.
But asking me where I'm from. Why do they ask me where
I'm from? Does that make a difference? Does that change
things?
Malaysia is an Islamic country. Suppose I say I'm from
the USA. They would kill me. Or at least think about
killing me.
Anyway. The Malays are not very smart. You know.
Schools here and so. At first I said "Sukarani" when
they asked me where I'm from.
You already know. There is no such country as Sukarani.
But do the Malays know? In fact they said "Thank you"
as I gave them a respond.
I used that word all the time. Now I found something
new. When they ask me where I'm from, then I say
"Malaysia".
And when I say "Malaysia", then I've got the Malay
thinking. This guy. Looks like a Westerner. Says he's
from Malaysia.
I see a disbelief in their eyes. And then I've got a
killer. "I'm a Bumi", I say to them. After saying they
shut up. They surrender.
Wait. A Bumi. What is a Bumi? You want to know what a
Bumi is. Let me tell you what a Bumi is. It's a Malay.
The majority of the people here.
In Malaysia you've got the Malays or the Bumi's, the
Chinese and the Indians. 65% of the people here is
Malay or Bumi.
You don't want to know where I'm from? You're not from
Malaysia! Have a good read.
Jos
*******************************************************
*******************************************************
*******************************************************
-------------------------------------------------------
3. Hatch 1
-------------------------------------------------------
Let's do something with hatch. Using an AutoLISP
routine we will make a drawing. And to the drawing we
will add two hatch patterns.
The drawing consists of two rectangles on the outside.
In the rectangles are two more rectangles. These
rectangles are smaller.
The hatch is in the smaller rectangle. The hatch is a
user defined hatch with an angle of 45 degrees and a
spacing of 10.
That is tricky about the hatch. We want the hatch to
start in the lower left corner of the smaller
rectangles.
How is that done? Easy. There is one thing you just
know. A hatch always starts in the origin of a drawing.
So it starts in point 0,0.
So what must we do before we apply the hatch to the
smaller rectangles? We must move the origin of the UCS
to the corners of the rectangles.
Enough said. Now we can write the AutoLISP routine for
creating the AutoCAD drawing. In the AutoLISP routine
are the following parts:
- drawing of the outside rectangles
- drawing of the smaller rectangles
- adding hatch patterns to the smaller rectangle
Let's make out AutoLISP routine fancy. We can have a
function for each part of the AutoLISP routine. But
let's work with functions.
We will create a function for drawing the rectangles
and we will have a function for adding a hatch pattern
to a rectangle.
We start with drawing the rectangles. Here's the
AutoLISP routine that will draw all the rectangles. It
has got a function for drawing a rectangle.
Here's the AutoLISP routine so far. The AutoLISP
routine will draw the two outer rectangles and the two
inner rectangles.
1. (defun c:ahtch ()
2. (setvar "cmdecho" 0)
3. (setq om (getvar "osmode"))
4. (setvar "osmode" 0)
5. (command "erase" "all" "")
6. (drrct (list 0 0)
7. (list 0 0)
8. (list 300 250)
9. )
10. (drrct (list 0 0)
11. (list 10 10)
12. (list 290 240)
13. )
14. (setq ls (drrct (list 0 0)
15. (list 50 50)
16. (list 150 100)
17. )
18. e1 (nth 0 ls)
19. d1 (nth 1 ls)
20. a1 (nth 2 ls)
21. )
22. (setq ls (drrct (list 0 0)
23. (list 150 150)
24. (list 250 200)
25. )
26. e2 (nth 0 ls)
27. d2 (nth 1 ls)
28. a2 (nth 2 ls)
29. )
30. (command "zoom" "extents")
31. (command "zoom" "0.9x")
32. (setvar "osmode" om)
33. (setvar "cmdecho" 1)
34. (princ)
35. )
In line 6, 10, 14, and 22 a call is made to the
function for drawing a rectangle. In the first two
calls nothing is done with what's given back.
In the third and the fourth call to the function for
drawing a rectangle there is something done with what's
given back by the function.
We must do something with what's given back Because
what's given back by the function we need for adding
the hatch pattern.
And here's the function for drawing a rectangle. The
function works with three arguments. The three
arguments are points.
1. (defun drrct (p0 p1 p2)
2. (command "rectangle" p1 p2)
3. (setq ds (distance p0 p1)
4. an (angle p0 p1)
5. )
6. (list (entlast) ds an)
7. )
The first point is the base point of the drawing. It is
the present location of the origin of the YCS. It is
point 0,0.
The distance and the angle from the base point of the
drawing till the first point of the drawing is
measured.
The name of the rectangle entity, the distance, and the
angle is given back by the function. Later we need that
information when adding the hatch.
Time for a break. In the next article I'll explain how
the hatch pattern is added to the tow smaller
rectangles.
*******************************************************
Writer of this article is Jos van Doorn.
Once you start with AutoLISP, you will be saving lots
of time and money with AutoCAD. Don't know AutoLISP?
Here are the books for learning.
http://autocadbooks.topcities.com
*******************************************************
*******************************************************
*******************************************************
*******************************************************
-------------------------------------------------------
4. Privacy policy, Advertising Info, and Legal Stuff
-------------------------------------------------------
This newsletter is only sent on request. Our list of
subscribers is strictly confidential. That means that
your details have never been and never will be passed
on to any third party.
Your privacy is greatly respected. Should you ever wish
to unsubscribe, full instructions are always provided.
To subscribe:
mailto:acadnewslett-@topica.com
To unsubscribe:
mailto:acadnewslette-@topica.com
Previous issues of the newsletter can be seen at:
http://www.topica.com/lists/acadnewsletter/read
Advertising info:
If you wish to advertise in this newsletter, you
shouldn't wait a second longer. Ad rates now are the
lowest for the season.
The ad rates are:
Top sponsor message: $5 per issue
Ad in the sponsors section: $2 per issue
The ad guidelines are:
Ads have to be up to 5 lines including a URL and a
mail to tag. Each line can have up to 55 chars max.
Legal stuff:
ACAD newsletter publishes original content and tips
that are distributed by readers. ALL of our articles
are original and copyrighted by Jos van Doorn.
If you wish to publish any of the content here in your
newsletter please contact Jos van Doorn at
mailto:acad-@hotmail.com
He's the publisher of this newsletter. Write PUBLISH in
the subject line.
Reprinting or reproducing this newsletter can be done
only if you keep it all together. You may NOT reproduce
any part of this newsletter in a way without a written
permission from Jos van Doorn. The signatures are to
be kept intact.
More stuff:
In the archive you can find ll back issues of the ACAD
Newsletter. This is the web site address where you can
find the archive:
http://www.topica.com/lists/acadnewsletter/read
At the web site of the ACAD Newsletter a lot of
applications can be found. There you can also find back
issues bundled in PDF files. Here's the web site:
http://groups.yahoo.com/group/acadnewsletter/files
-------------------------------------------------------
Disclaimer:
ACAD newsletter accepts no responsibility whatsoever
for the content or legality of any customer's
advertisement shown in any e-mailing.
It is the advertisers' responsibility to check and
abide by the Local, State, Federal and International
laws pertaining to the products, services or business
opportunities they advertise, as well as all laws
pertaining to the products, services and/or business
opportunities promotions.
All offers in this publication, are void where
prohibited by law!
*******************************************************
*******************************************************
*******************************************************
-------------------------------------------------------
5. Contact Information
-------------------------------------------------------
Jos van Doorn - publisher ACAD newsletter
Jalan Watan 12
CA-4-24
68000 Bandar Baru Ampang
Malaysia
(03) 42706214
mailto:acad-@hotmail.com
*******************************************************
*******************************************************
*******************************************************
_________________________________________________________________
Block pop-up ads with MSN Toolbar. http://toolbar.msn.com.my/
|
|
 |
|