Visual Lisp Tutorial (Afra)
Visual Lisp Tutorial (Afra)
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
● Userforms.
● Lisp To VBA.
● AutoCAD and Customizable Support Files
● VBA and Menu's
● VBA and Sequencial Text Files
● Hiding Dialogs and Other Things
● PolyLines and Arcs by Scott McGlynn
● Accessing AutoCAD by Scott McGlynn
● File Functions In Visual Basic
● Error Trapping
VBA Applications
● VBA Batch Purge.
● Change Text.
● VBA and Outlook.
● VBA and Powerpoint.
● Command Line Project.
● VBA Fax Project.
VB Standalone Applications
● Create a Toolbar DLL.
● Create a Toobar DLL Re-Visited
● DLL Resource Tool
● AfraLisp Screensaver.
● Batch Purge 2002.
● Batch Purge 2004.
● RC-Batcher.
● Randall Raaths Lisp Manager.
● VBA Partial Menu.
● The Acad Export Drawings Project.
● Batch Purge Project.
● AfraLisp Drawing Backup
● How to write unmaintainable code
● Shadow Controls
● AfraLisp Coffee Holder
● AutoCAD and HTML - VB
● Custom Application Setup
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Welcome to AfraLisp
AfraLisp now publishes over 100 AutoLisp Tutorials and nearly 50 VB/VBA Tutorials all open source and
complete with working examples. AfraLisp also publishes a download section containing many custom
AutoLisp applications written by AfraLisp as well as others.
AfraLisp also collaborates greatly with some other brilliant AutoLisp/VB/VBA sites, namely :
The Cad Vault is focused on helping you to improve your work environment
with tutorials and working code examples written in, and for, the most
popular customizing languages for the major CAD software programs and Microsoft Office products - Visual Basic
for Applications, Visual Basic, Visual C++, AutoLisp, Visual Lisp, and DCL.
And last but by no means least, CORBIMITE.COM is the host of AfraLisp and my thanks go to Frank
Zander for his generosity and support.
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
● The Beginning
● Viewing Objects
● Properties & Methods
● Methods Reference
● Arrays
● Selecting Objects
● Collections
● Reactors
● Menu's
● Error Trapping
● Layers
● Profiles
● Sample Profile Utilities
● Attributes
● Attributes Re-visited
● Loading VBA Files
● Directories and Files
● Compiling AutoLisp Files
● VLAX Enumeration Constants
● Polylines
● The Utilities Object
● Visual Lisp and VBA
● AutoCAD and HTML - Visual Lisp
● The AfraLisp Visual Lisp Tutorials
● David Steins's Visual LISP Developers Bible
● Visual Lisp Sample Files
● Scripting Objects
● "Talking" to External Applications
● How to make Tripe and Onion's
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp Newsletter
Would you like the AfraLisp Newsletter delivered to your desktop?
If so, then just enter your email address in the box below and press the "Submit" button.
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Archives 2004
Archives 2003
Archives 2002
Archives 2001
Archives 1999
Latest Updated Download : Issue 03-05-99 to 2004-07 Dated March 9th 2004 ( 1033 Kb )
New!! You can now download the AfraLisp Newsletters PLUS all 3 AfraLisp Books in one installation file. To do
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
"Utter Rubbish"
Page II Page III Page IV Page V
Warning : Some of the articles in this section are slightly blue in nature, include bad language, are sexist
and are generally insulting to a whole cross section of people.
You have been warned!!
Disclaimer: If you take this section seriously you are an idiot, and any damages caused by taking these
articles seriously are deemed to be too bad.
Hi Guys
We have been putting in long hours recently but we’ve really come together as a
group and I love that. However, while we are fighting a jihad, we can’t forget to
take care of the cave, and frankly I have a few concerns:
Second: It is not often I make a video address but when I do, I’m trying to scare the
living shit out of most of the world’s population, okay? That means that while we’re
taping; please do not ride your scooter in the background or keep doing the
“Wassup” thing. Thanks.
Third: Food. I bought a box of Dairylea recently. Clearly wrote “Ossy” on the front,
and put it on the top shelf. Today, two of my Daillea slices were gone.
Consideration. That’s all I’m saying.
Fourth: I’m not against team spirit and all that, but we must distance ourselves
from the Infidel’s bat and ball games. Please do not chant” Ossy, Ossy Ossy, Oy Oy Oy
when I ride past on my donkey. Thanks.
Five: Graffiti. To whoever wrote “OSAMA SHAGS DONKEYS” on the group toilet wall,
it’s a lie. The donkey backed into me whilst I was relieving myself at the edge of the
mountain.
Six: The use of chickens is strictly for food. Assam, the old excuse that the chicken
backed into me, whilst I was relieving myself at the edge of a mountain’ will not
be accepted in the future. (With donkeys, there is a grey area)
Finally: We’ve heard that there may be Western soldiers in disguise trying to infiltrate
IF YOU'VE been to a gas station lately, you have no doubt been shocked by the prices: $1.67, $1.78,
even $1.92. And that's just for Hostess Twinkies. Gas prices are even worse. Americans are ticked off
about this, and with good reason: Our rights are being violated! The First Amendment clearly states: "In
addition to freedom of speech, Americans shall always have low gasoline prices, so they can drive
around in 'sport utility' vehicles the size of minor planets."
And don't let any so-called "economists" try to tell you that foreigners pay more for gas than we do.
Foreigners use metric gasoline, which is sold in foreign units called "kilometers," plus they are paying
for it with foreign currencies such as the "franc," the "lira" and the "doubloon." So in fact there is no
mathematical way to tell WHAT they are paying.
But here in the United States we are definitely getting messed over, and the question is: What are we
going to do about it?
Step 1, of course, is to file a class-action lawsuit against the cigarette companies. They have nothing to
do with gasoline, but juries really hate them, so we'd probably win several hundred billion dollars. But
that is a short-term answer. To truly solve this problem, we must understand how the oil business
works. Like most Americans, you probably think that gasoline comes from the pump at the gas station.
Ha ha! What an idiot. In fact, the gasoline comes from tanks UNDER the gas station. These tanks are
connected to underground pipelines, which carry large oil tankers filled with oil from the Middle East.
But how did the oil get in the Middle East in the first place? To answer that question, we must go back
millions of years, to an era that geologists call the Voracious Period, when giant dinosaurs roamed the
Earth, eating everything that stood in their path,
except for broccoli, which they hated. And then, one fateful day (Oct. 8), a runaway asteroid, believed by
scientists to be nearly twice the diameter of the late Orson Welles, slammed into the Earth and killed the
dinosaurs, who by sheer bad luck all happened to be standing right where it landed. The massive
impact turned the dinosaurs, via a process called photosynthesis, into oil; this oil was then gradually
covered with a layer of sand, which in turn was gradually covered by a layer of people who hate each
other, and thus the Middle East was formed. For many years, the Middle East was content to supply the
United States with as much oil as we wanted at fair constitutional prices. But then the major
oil-producing nations-Saudi Arabia, Iran, Iraq, Kuwait and Texas-got all snotty and formed an
organization called OPEC, which stands for "North Atlantic Treaty Organization." In the 1970s, OPEC
decided to raise prices, and soon the United States was caught up in a serious crisis: The Disco Era. It
was horrible. You couldn't go to a bar or wedding reception without being ordered onto the dance floor
to learn "The Hustle."
AT THE SAME time, we also had an oil crisis, which was caused by the fact that every motorist in the
United States was determined to keep his or her automobile gas tank completely filled at all times. As
soon as your gas gauge dropped from "Full" to "Fifteen-sixteenths," you'd rush to a gas station and get
in a huge line with hundreds of other motorists who also had nearly full tanks. Also a lot of people,
including me, saved on heating oil by buying kerosene space heaters, which enabled us to transform a
cold, dank room into a cold, dank room filled with kerosene fumes. Buying gas and dancing "The
Hustle" with people who smelled like kerosene: That was the '70s.
So anyway, the oil crisis finally ended, and over time we got rid of our Volkswagen Rabbits and replaced
them with Chevrolet Suburbans boasting the same fuel economy as the World Trade Center. Now, once
again, we find ourselves facing rising gas prices, and the question is: This time, are we going to learn
from the past? Are we finally going to get serious about energy conservation? Of course not! We have
the brains of mealworms! So we need to get more oil somehow. As far as I can figure, there's only one
practical way to do this. That's right: We need to clone more dinosaurs.
We have the technology, as was shown in two blockbuster scientific movies, "Jurassic Park" and
"Jurassic Park Returns with Exactly the Same Plot." Once we have the dinosaurs, all we need is an
asteroid. Or, if he is available, Marlon Brando.
If this plan makes sense to you, double your medication dosage, then write to your congressperson.
Do it now! That way you'll be busy when I siphon your tank.
Aussie Humour
From down under.
If you take an Oriental person and spin him around several times, does he become disoriented?
- Only if he has to much to much saki before hand.
If people from Poland are called Poles, why aren't people from Holland called Holes?
- Dutchmen were called 'Holes' before the Pope in the Vatican kicked up a fuss when they were refered to as
'Holey-men'.
Why is the man who invests all your money called a broker?
- The word 'broker' has Spanish origins, alboroque, meaning 'ceremonial gift at conclusion of business deal'.
e.g., while they are making you money, they get a 'little gift' along the way.
Why is a person who plays the piano called a pianist, but a person who drives a race car not called a
racist?
If lawyers are disbarred and clergymen defrocked, doesn't it follow that electricians can be delighted,
musicians denoted, cowboys deranged, models deposed, tree surgeons debarked and dry cleaners
depressed?
- And I dare say porn stars are denuded, wine makers are deported, portrait artists are defaced and hens are
delayed.
Why do croutons come in airtight packages? It's just stale bread to begin with.
- And why does sour cream have a use-by date ?
If you mixed vodka & orange juice with milk of magnesia, would you get a Philip's Screw Driver?
- I dunno, but if you had too many, you'd vomit half back up and the other half out the rear end!!!
'I am' is reportedly the shortest sentence in the English language. Could it be that 'I do' is the longest
Why do women wear evening gowns to nightclubs? Shouldn't they be wearing nightgowns?
- A nightgown is a loose undergarment which women wear to bed. I should hope no female wishes to go out in
her nightgown [or maybe I should be hoping]
When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to
the other penny?
- This was all part of the government's harsh "50% Two Cent Thought Tax" where after you have given your two
cents, the recipient must then remit 50% [one cent] to the tax department before the end of the month.
If you throw a cat out of the car window, does it become kitty litter?
- Only say, if another cat came up to it in the street, did it's business on its head, covered it with some gravel,
and then some-one chased you down to tell you to change it more often because it still stinks.
What hair color do they put on the driver's license of a bald man?
- Most say 'none', but the modest ones say 'transparent'.
When dog food is new and improved tasting, who tests it?
- Erm... dogs.
How does the guy who drives the snowplough get to work?
- Special underground cave networks that only classified people are allowed to know about.
If the 7 11 is open 24 hours a day, 365 days a year, why does it have locks on the door?
- For when it closes every 4 years on Feb. 29, the 366 day in a leap year.
If a fire-fighter fights fire and a crime fighter fights crime, what does a freedom fighter fight?
- Erm... freedom.
If they squeeze olives to get olive oil, how do they get baby oil?
- Of course, they only very gently squeeze them.
Why do you need a driver's license to buy liquor when you can't drink and drive?
- Back in the days of alcohol prohibition, some retailers found a loop-hole in the law. The found it was not illegal
to sell liquor if it was to only be drunk in the vehicle whilst stationery, where they needed proof that the buyer did
own a car by having them show their licence. The tradition remains today.
Why are there flotation devices in the seats of planes instead of parachutes?
- We all know dead bodies in orange floaties are easier to see than dead bodies under parachutes.
You know that indestructible black box that is used on airplanes? Why don't they make the whole plane
out of that stuff?
- Would you want to fly in a big, black, rectangular box which taped each conversation you had during your flight
and could only be opened by special secret-service agents ?
If you are driving at the speed of light and you turn your headlights on, what happens?
- The particles of light, or 'photons' they are called, are so abrasive at that as they slow down and you continue
your speed, it wears away at your car until of course, you crash and die.
Why is it that when you transport something by car it is called shipment, but when you transport
something by ship it's called cargo?
- 'Shipment' by car was coined when people carting goods by car on a ferry was still called by ship, even when it
reached land, to tell where it came from. Ship's 'cargo' is from the French when the primary use of boats in
France was to ship snails for consumption [or as its called 'escargot'].
Why are they called apartments when they are all stuck together?
- 'Apartments' were first built in the 1700's by the Scots, where they were apart from each other in the rural
country areas, some up to 3 miles apart. But fashionable Scots found moving them into cities required them to
be built next to each other.
The Officer looks at the woman and slowly backs away to his car and calls for back up. Within minutes 5
police cars circle the woman and a senior officer slowly approaches the car, clasping his half drawn
gun.
The woman opens the trunk, revealing nothing but an empty trunk.
Officer 2: The officer claims that you do not have a driver's license.
The woman digs into her handbag and pulls out a clutch purse and hands it to the officer. The officer
snaps open the clutch purse and examines the license. He looks quite puzzled.
Officer 2: I must admit, ma'am, that I'm confused; the officer told me you didn't have a license, that you
stole this car, and that you murdered the owner.
Woman: I suppose the lying bastard told you I was speeding, too.
I heard today that Iraq had developed a special weapon for use against the Canadian Navy. It was called
a rust-seeking missile.
===========
In Iraq, I believe that they're replacing 100,000 Desert Marines with 1,000 women with PMS.
They're meaner, and they can retain water for 7 days
===========
What was Saddam Hussein's wife telling neighbors who asked why she's leaving the country?
===========
Adviser: "Well, Mr. President, the deadline's expired. What shall we do?"
Bush: "Send in Colin Powell!"
Adviser: "Isn't that rather a limited strike, sir?"
Bush: "No, I mean send him in to my office!"
Powell: "Sir!"
Bush: "What would be the result of an air strike on Wednesday night?"
Powell: "Millions of innocent civilians killed and the city razed to the ground, Sir!"
Bush: "You know I don't understand that military jargon! Give it to me in words I can understand."
Powell: "Personnel density adjustment and strategic collateral upheaval, Sir!"
Bush: "That bad?!"
===========
===========
I can't quite call anything that drops off a plane traveling several hundred miles an hour and few
===========
B-52...F-16...B-52
===========
Stanley stops by to visit his friend who is paralyzed from the waist down.
They talk for a while and then the friend asks, "My feet are cold.
Would you be so kind as to go get me my house slippers please?"
Stanley obliges and goes upstairs.
There he sees his friend's daughters, both very good looking.
Being the adventurous and quick thinking kind, he says.....
"Hi, ladies! Your daddy sent me here to have sex with you!"
They stare at him and say, "That can't be!"
He replies, "OK, let's check!"
He shouts at his friend down the stairs, "Both of them?"
......"Yes, both of them!"
New Technology
An American, a Japanese and an Irishman were sitting naked in a sauna. Suddenly, there was a beeping
sound. The American pressed his forearm and the beep stopped. The others looked at him
questioningly. "That was my pager," he said, "I have a microchip under the skin of my arm." A few
minutes later a phone rang. The Japanese fellow lifted his palm to his ear. When he finished he
explained "That was my mobile phone, I have a microchip in my hand." The Irishman felt decidedly low
tech, but not to be outdone he decided he had to do something just as impressive. He stepped out of
the sauna and went to the toilet. He returned with a piece of toilet paper hanging from hisbehind. The
others raised their eyebrows and stared at him.
The Irishman finally said Well, will you look at that, I'm getting a fax.
9 - "I need this parade like I need a f___ing hole in the head!" -
JFK,1963
10 - "Aw c'mon. Who the f___ is going to find out?" - Bill Clinton,1997
What is a Yankee?
The same as a quickie, but a guy can do it alone.
What do you see when the Pillsbury Dough Boy bends over?
Doughnuts.
Why is it so hard for women to find men that are sensitive, caring, and good-looking?
Because those men already have boyfriends.
What did the blonde say when she found out she was pregnant?
"Are you sure it's mine?"
Why do drivers' education classes in Redneck schools use the car only on Mondays, Wednesdays and
Fridays?
Because on Tuesday and Thursday, the Sex Ed class uses it.
Did you hear about the Chinese couple that had a retarded baby?
They named him "Sum Ting Wong"
What would you call it when an Italian has one arm shorter than the other?
A speech impediment.
What does it mean when the flag at the Post Office is flying at half-mast?
They're hiring.
How do you get a sweet little 80-year-old lady to say the F word?
Get another sweet little 80-year-old lady to yell *BINGO*!
What did the guitarist do when his teacher told him to turn his amplifier on?
He caressed it softly and told it that he loved it.
How many country & western singers does it take to change a light bulb?
Three. One to change the bulb and two to sing about the old one.
"Will you use it to gamble instead of buying food?" the man asked.
"No, I don't gamble," the homeless man said. "I need everything I can get just to stay alive."
"Will you spend the money on greens fees at a golf course instead of food?" the man asked.
"Are you NUTS!" replied the homeless man. "I haven't played golf in 20+ years!"
"Well," said the man, "I'm not going to give you two dollars. Instead, I'm going to take you home for a
terrific dinner cooked by my wife."
The homeless man was astounded. "Won't your wife be furious with you for doing that? I know I'm dirty,
and I probably smell pretty bad."
The man replied, "Hey, man, that's okay! I just want her to see what a man looks like who's given up
beer, gambling, and golf!
Five men were bragging about how smart their dogs were. One was an
engineer, the second man was an accountant, the third man was a chemist,
the fourth was a computer tech, and the fifth was a government worker.
But the accountant said his dog could do better. He called to his dog
and commanded "Spreadsheet, do your stuff."
Spreadsheet went out into the kitchen and returned with a dozen
cookies. He divided them into 4 equal piles of 3 cookies each. Everyone
agreed that was good.
But the chemist said his dog could do better. He called to his dog
and said,"Measure, do your stuff. " Measure got up, walked over to
the fridge, took out a quart of milk, got a 10 ounce glass from the
cupboard and poured exactly 8 ounces without spilling a drop. Everyone
agreed that was
more than a little impressive.
The computer tech knew he could top them all."Hard Drive' have at
it." Hard Drive crossed the room and booted the computer, checked for
viruses, upgraded the operating system, sent an email, and installed a cool
new game.
Everyone knew that was a tough act to follow.
Then the four men turned to the government worker and said, "What can
your dog do?"
The government worker called to his dog and said, "Coffee Break, do
your stuff, Boy."
Coffee Break jumped to his feet, ate the cookies, drank the milk,
erased all the files on the computer, screwed the other four dogs, claimed
he injured his back while doing so, filed a grievance report for
unsafe working conditions, put in for workers compensation and went
home for six-month sick leave.
A man walks into a pharmacy and wanders up and down the aisles.
The salesgirl notices him and asks him if she can help him.
He answers that he is looking for a box of tampons for his wife.
She directs him down the correct aisle.
A few minutes later, he deposits a huge bag of cotton balls and a ball of string on the counter.
She says, confused, "Sir, I thought you were looking for some tampons for your wife?"
He answers, "You see, it's like this. Yesterday, I sent my wife to the store to get me a carton of
1. People who point at their wrist while asking for the time....I know where my watch is pal, where the
f*ck is yours? Do I point at my crotch when I ask where the toilet is?
2. People who are willing to get off their arse to search the entire room for the TV remote because they
refuse to walk _to the TV and change the channel manually.
3. When people say "Oh you just want to have your cake and eat it too"
F*cking right! What good is a cake if you can't eat it?
4. When people say "it's always the last place you look". Of course itis. Why the f*ck would you keep
looking _after you've found it? Do people do this? Who and where are they?
5. When people say while watching a film "did you see that?". No tosser,
I paid 10 quid to come to the cinema _and stare at the f*cking floor.
6. People who ask "Can I ask you a question?". Didn't really give me a choice there, did you sunshine?
7. When something is 'new and improved!'. Which is it? If it's new, then there has never been anything
_before it. If it's an improvement, then there must have been something before it.
8. When people say "life is short". What the f*ck?? Life is the longest damn thing anyone ever f*cking
does!! What can you do that's longer?
9. When you are waiting for the bus and someone asks, "Has the bus come yet?".
If the bus came would I be standing here, Knobhead?
10. People who say things like 'My eyes aren't what they used to be'.
So what did they used to be? ears, _Wellington boots?
11. When you're eating something and someone asks 'Is that nice? 'No it's really revolting - I always eat
stuff I hate.
12. People who announce they are going to the toilet. Thanks that's an image I really didn't need.
13. McDonalds staff who pretend they don't understand you unless you insert the 'Mc' before the item
you are ordering.....It's has to be a McChicken Burger, just a Chicken Burger get blank looks. _Well I'll
have a McStraw and jam it in your McEyes you _f*cking McTosser.
14. When you involved in a accident and someone asks 'are you alright?'Yes fine thanks, I'll just pick up
my _limbs and be off - See Ya.
Age
(Authors Unknown)
------------------------------------
------------------------------------
Morris, an 82 year-old man, went to the doctor to get a physical.
A few days later the doctor saw Morris walking down the street with a gorgeous young lady on his arm.
A couple of days later the doctor spoke to Morris and said, "You're really doing great, aren't you?"
Morris replied, "Just doing what you said, Doc: 'Get a hot mamma and be cheerful.' "
The doctor said, "I didn't say that. I said, 'You got a heart murmur. Be careful.'"
------------------------------------
As a senior citizen was driving down the freeway, his car phone rang.
Answering, he heard his wife's voice urgently warning him, "Herman, I just heard on the news that
there's a car going the wrong way on Interstate 280. Please be careful!"
"It's not just one car," said Herman. "It's hundreds of them!"
----------------------------------------
An elderly gent was invited to his old friends' home for dinner one evening.
He was impressed by the way his buddy preceded every request to his wife with endearing terms -
Honey, My Love, Darling, Sweetheart, Pumpkin, etc...
The couple had been married almost 70 years, and clearly they were still very much in love.
While the wife was in the kitchen, the man leaned over and said to his host,
"I think it's wonderful that, after all these years, you still call your wife those loving pet names."
The old man hung his head. "I have to tell you the truth," he said, "I forgot her name
about 10 years ago."
Personal cost to me to produce the new CD, $3000 US (remember, there's 4 in the band). We've now
moved into the realms of Video/DVD - my share so far, $500 US - and we've just started on this project.
This does not include personal time, leave from work, personal equipment costs such as guitar strings,
amp blowing up, etc. Oh, and my beer bill is horrendous and my wife often doesn't speak to me.
We will recover most of it within a month - maybe two, but the point I'm trying to make is this! To
succeed - or should I get to basics here - to make a living out of something you do, takes a great deal of
investment in yourself.
I read nearly every post on VB Expresso, and I must say one thing - there are some really talented
people within this forum. BUT................ a lot of you have not got a clue of how to market yourself or
your talents. How can you say that Kenny? We are the elite of the CAD coding world. We can answer
any question that is thrown at us. We are the best!
Humbug. I say!!
First lesson:
You must learn how to sell yourself.
Don't do or give anything for free unless you receive some sort of payment, no matter how indirectly, in
Example: I run AfraLisp and have spent many hours and "given" away lot's of ideas. True, but in my part
of the world, my marketability is way above my peers. And so is my salary and other perks.
Second Lesson:
You must learn how to communicate.
Example: Why do you have a strange handle such as "butlicker" or "womanizer"? Use your name. If
you're afraid of being recognized and your words don't carry the courage of your convictions, then don't
bother posting. You cannot use your participation on the web in your CV if you use a strange name.
Remember, this is business. It is not a teenage chat room. Check your spelling and your grammar. Hey,
your next boss could be reading your last post.
Example: I get all sorts of correspondence in regards to AfraLisp and Cad Encoding. The majority is
good, some downright rude. Each and every one receives a reply varying from friendly to polite, polite
being the key word here. Yes, you do have to put up with shit. Hey, it's a tough world. Don't dish it back,
learn how to deal with it. The web makes it very easy to hide behind an electronic screen. Don't do it!
Handle it like the professional that you profess to be. I work day to day with people that I don't
particularly like. So what? Must I slag them off because they do things I don't like. No I don't, I work with
them. The same goes when communicating on the web.
Example: My wife is an ex-trainee accountant. She is now a librarian. Heather looks after all the money.
We don't have much, but every cent is accounted for. ALL my software is licensed. Some of it I paid for -
some I was given 'cos I'm nice.
Me, well I was in exactly the same place as I am now - Oranjemund, Namibia. In those long lost days
though, I was a lowly design draughtsman with a year to go before I hit the big time and got the
promotion I so richly deserved. My oldest son was 12, my second 10, and my daughter still a wee mite
of 8 years. At this time of the year, we were getting all prepared to send off my oldest to boarding school
in Cape Town. He wanted to take a puppy. I said no!!
Programming - If memory serves me correctly, this was just about the time that we received our
upgrades from R12 to R13. We were still working in DOS, and I had no idea about such things as dialog
boxes, especially designing your own. Until that point, I'd been modifying the AutoCAD pull down
menus to run macros and AutoLisp routines. When R13 hit me, partial menus had come into play and
the buggers at AutoDesk had changed the whole format of the menu system. Just like that, everything
I'd written became null and void. Not that my programs were wrong and didn't work anymore. No, they
were more devious than that! I now couldn't trigger the bloody things.
This was my slow painful entry into the world of DCL. You may laugh now, but remember, in those days
we had no choice. VBA didn't exist. AutoLisp or nothing!!
To make matters worse, email and the Internet didn't exist, and being stuck in the middle of the desert I
had no access to any of the few AutoCAD magazines that were published in those days. I was stuck
with the AutoCAD reference manuals. Never, ever, ever do I want to repeat that exercise again and I
Political - In Namibia, we'd gone through our independence a couple of years previously so things had
pretty well settled down. Our neighbour South Africa though - whom we rely on to a large degree - was
busy going through the birth pains of a change of government and the end of apartheid. Mandela was
about to be released, and there was a lot of concern over civil war breaking out. Thank the Lord it didn't.
People were hoarding food and fuel, rumours were flying around and everyone - white, black, pink and
green - were worried. Turmoilous times.
Music - I was "retired" from music at that time and to keep myself busy had got heavily involved with
the local amateur theatre on the directing and production side. Good fun. Pantomimes, Variety Shows,
even one or two "serious" productions. Some times I miss it. Mostly I don't. Why? Well in a band you've
got maybe 4 or 5 egos to contend with. In the theatre there's bloody hundreds - including the person
who takes the tickets. Never again - well, maybe once.
Other Hobbies - well I build two wooden ships from scratch with just the plans, and a few bits of
wood. (Honest). In fact my son Daniel said to his Mum today that when Dad dies he would like my ships.
Mmm - is that good or bad.
I also started playing Lawn Bowls - go on laugh. Great game and better than bloody golf 'cos at least
you don't lose your balls - or your temper.
(By the way - I ended up being Namibian Open Singles Champion and I've got the medals and photo's to
prove it. So there).
Insulting Humour
(Just replace the names with those of your enemies.)
(Authors Unknown)
Kenny died in a fire and was burnt pretty badly and the morgue needed someone to identify the body. Of
course, his two best friends, Cornbread and Kinat, were sent for.
Cornbread went in and the mortician pulled back the sheet.
He said "Yup, he's burnt pretty bad. Roll him over". So the mortician rolled him over and Cornbread
looked and said "No, that ain't Kenny."
The mortician thought that was rather strange and then he brought Kinat in to identify the body. He took
a look at him and said, "Yup, he's burnt real bad, roll him over" The mortician rolled him over and Kinat
looked down and said, "No, that ain't Kenny"
The mortician asked, "How can you tell?"
Cornbread said, "Well, Kenny had two arseholes."
"What? He had two arseholes?" said the mortician.
"Yup, everyone knew he had two arseholes. Every time we went into town, folks would say........
"Here comes Kenny with them two arseholes...."
-------------
Randall walks into a bar, orders three pints of Guinness and sits in the back of the room, drinking a sip
out of each one in turn. When he finishes them, he comes back to the bar and orders three more.
The bartender asks him, "You know, a pint goes flat after I draw it; it would taste better if you bought
one at a time."
Randall replies, "Well, you see, I have two brothers. One is in Africa, and the other in Australia, and I'm
here in the US of A. When we all left home, we promised that we'd drink this way to remember the days
when we drank together."
The bartender admits that this is a nice custom, and leaves it there.
Randall becomes a regular in the bar, and always drinks the same way: He orders three pints and drinks
them in turn.
One day, he comes in and orders two pints. All the other regulars notice and fall silent.
When he comes back to the bar for the second round, the bartender says, "I don't want to intrude on
your grief, but I wanted to offer my condolences on your great loss."
Randall looks confused for a moment, then a light dawns in his eye and he laughs, "Oh, no" he says,
"everyone's fine. I've just quit drinking."
---------------
Dear Marie:
I have been engaged for almost a year. I am to be married next month.
My fiancee's mother is not only very attractive but really great and understanding. She is putting the
entire wedding together and invited me to her place to go over the invitation list because it had grown a
Dirty Howi
------------
Stig Madesen feeling very depressed walked into a bar and ordered a triple scotch. As the bartender
poured him the drink he remarked, "That's quite a heavy drink. Is something wrong?" After quickly
downing his drink Stig replied, "I got home and found my wife in bed with my best friend."
"Wow", exclaimed the bartender as he poured the man a second triple scotch, "No wonder you needed a
stiff drink. This one's on the house."
As Stig finished the second scotch, the bartender asked him, "So what did you do?"
"I walked over to my wife", Stig replied, "looked her straight in the eye and told her that we were
through. I told her to pack her bags and get the hell out."
"That makes sense", said the bartender, "but what about your best friend?"
"I walked over to him, looked him right in the eye and said 'Bad dog!'"
----------
Sherko walks into a bar and says "Gimme twenty shots of your best bourbon." The bartender pours the
shots, and Sherko immediately pounds them all down like a madman.
The bartender says "Man, I've never seen anybody drink like that before."
Sherko says "You'd drink like that too if you had what I have."
"What do you have?" asks the bartender.
Sherko says "Fifty cents."
● Never give me work in the morning. Always wait until 4:00 and then bring it to me. The challenge
of a deadline is refreshing.
● If it's really a rush job, run in and interrupt me every 10 minutes to inquire how it's going. That
helps. Or even better, hover behind me, advising me at every keystroke.
● Always leave without telling anyone where you're going. It gives me a chance to be creative when
someone asks where you are.
● If my arms are full of papers, boxes, books, or supplies, don't open the door for me. I need to
learn how to function as a paraplegic and opening doors with no arms is good training in case I
should ever be injured and lose all use of my limbs.
● If you give me more than one job to do, don't tell me which is priority. I am psychic.
● Do your best to keep me late. I adore this office and really have nowhere to go or anything to do. I
have no life beyond work.
● If a job I do pleases you, keep it a secret. If that gets out, it could mean a promotion.
● If you don't like my work, tell everyone. I like my name to be popular in conversations. I was born
to be whipped.
● If you have special instructions for a job, don't write them down. In fact, save them until the job is
almost done. No use confusing me with useful information.
● Never introduce me to the people you're with. I have no right to know anything. In the corporate
food chain, I am plankton. When you refer to them later, my shrewd deductions will identify them.
● Be nice to me only when the job I'm doing for you could really change your life and send you
straight to Engineers' hell.
● Tell me all your little problems. No one else has any and it's nice to know someone is less
fortunate. I especially like the story about having to pay so much taxes on the bonus check you
received for being such a good Engineer.
Benchmark Test
(Kenny Ramage - November 2002)
AutoCAD VV-Lite
Recently, I received an unusual request from AutoDesk :
"Hi Kenny," it said, "Knowing that you are a man of high intellect, have a good understanding of the
AutoDesk range of products, and have never been found guilty of anything as charges were always
dropped, we would like you to benchmark and test our latest product namely - "AutoCAD VV-Lite" or, to
reveal it's true name, "AutoCAD Very, Very Lite."
Following are a couple of major features I picked up on whilst testing this truly unique software package
:
● The first step is to select your mode of drawing. AutoCAD VV-Lite provides 3 modes - Horizontal
Mode, Vertical Mode and Angular Mode. Only one Mode at a time can be active. This exciting and
revolutionary feature removes all confusion and difficulty from having to remember what type and
orientation of entity you are drawing. A simple 3-way toggle switch, as used on the Space Shuttle,
allows you to cycle between modes.
An added bonus is that only one of the "Mode" types is displayed. This drastically reduces regen
time. e.g. If you are in "Horizontal Mode," only Horizontal entities are displayed.
● Pull Down, Screen and Toolbar Menu's have been totally eliminated. In their place, a "stick on"
screen menu has been provided. This new menu type comes in all screen sizes and resolutions to
suit your VDU. (TV screens, drive-in screens and ice creams are not yet supported.)
● All text is entered as normal, but appear on your screen in Lower Case Pittman's Shorthand. In
addition, all numeric characters are converted to binary code (1 and 0.)
Both these enhancements greatly help in reducing the pressure on system resources.
● Blocks and Xref's are not inserted. Hieroglyphics are used instead. They are fully customisable.
● Every entity automatically snaps to all other entities within the drawing to avoid confusion of
which snap to use.
● No scaling is necessary as "Not To Scale" is automatically applied to the drawing in the way of a
water mark.
● When you draw an entity or insert a block, and if the system doesn't like what you are doing, or if
you take to long, the entity is deleted and your immediate supervisor is informed via e-mail.
These are just a few of the more powerful features present in this new, vastly improved package of
goodies from the AutoDesk stable. Keep your eye out for AutoCAD VV-Lite. It should hit the shelves
around about the last quarter of this year.
AutoCAD Training
(Kenny Ramage - November 2002)
I don't hate training, I detest it. How I ever ended up with the responsibility of training people on
AutoCAD I don't know. Well I do really. It's 'cos of my big mouth and having a tendency to "volunteer"
for what I think will be an interesting experience. Silly me! I'll never learn. I don't mind workshops, in fact
I quite enjoy that aspect of training. A workshop is different. At most workshops you're dealing with
people that want to be there and want to learn. Straight forward training is a totally different matter.
There you're dealing with people who have all sorts of reasons and agendas for having to attend the
course. Here's a couple of my pet hates :
So, have you done any training? Have you got student types that you hate? Let me know and we'll add
them to the list.
His son returned with his newspaper and xunloaded to his father who put on his vports, opened the
newspaper and proceeded to readline.
"Dad," his daughter prompted, trying to entmake conversation. "Could I go to the function tonight?"
Father was immediately alert. Slowly he turned the textpage of his newspaper.
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Entity Length
This will display the length of most entities :
Rtext
Have you had a good look at the Express Tools yet? Under the Text sub-menu there is a little gem of a routine called
"Rtext." Using this application you can insert Diesel expressions anywhere in your drawing. This is great for Plot
Stamps and much easier to setup and maintain than other Plot Stamp applications. Just insert it into your template
drawings and away you go.
This "stamps" the Plotted Date and Time as well as the users Login name.
Check out the "Rtext" help for more details and more uses.
AutoLisp Comments
Do you know that you can write block comments in your AutoLisp files like this :
Lwpolyline
This AutoLISP function returns the vertex of a lwpolyline (print in this case). You can use this function
in AutoLISP routines to treat lwpolylines as AutoCAD Release 13 2D polylines.
(defun c:POINTS ()
(print)
(princ "\n")
(setq b nil)
(princ)
)
;Coding ends here
Model Tab
Have you ever wanted to want to view information about the Model tab or a Layout tab; for example,
such as the current output device and paper size.
The information for layout settings is now stored in the drawing dictionary.
Following is an example of how you would access the entity information for the Model tab in AutoLISP.
This code sets the "modelList" value equal to the entity information for the Model tab as they are stored
in the drawing dictionary. After running this routine, type !modelList on the command line and press
ENTER. The contents of modelList will be displayed on the command line.
ARX Applications
When using certain AutoCAD commands in AutoLISP that are called from ARX applications (for
example, ROTATE3D and MIRROR3D), the following error message is displayed:
UNKNOWN Command
This error occurs because the ARX application was not already loaded into memory. To work around
this you must first determine what ARX application the command is from.
The following example AutoLISP routine uses the ROTATE3D command and determines if the
associated ARX application is loaded, and loads the application if it is not already loaded.
Vertex Coordinates
You try to obtain the vertex coordinates of a 3D polyline using the following AutoLISP expression.
However, this expression only returns basic information about the 3D polyline; it does not return the
vertex coordinates, which are stored as a sub-entity of the 3D polyline.
Copy and paste the following coding into Notepad and save it as "ListVertex.lsp."
To run the routine, type ListVertex on the command line and press ENTER.
A list of all loaded ARX applications will be created. If the geom3d.arx file is not listed, it will be loaded,
and a 3D cylinder will be created and rotated.
Drawing Path
To get the full path, you append the DWGPREFIX system variable (which stores the path) to the
DWGNAME system variable (which stores the file name).
Use code such as the following example to retrieve and assign the values of DWGNAME and
DWGPREFIX to variables in AutoLISP :
Use the AutoLISP function (strcat), to concatenate the results and assign them to a variable, for
example :
In this example, the variable TM contains the full path including the file name.
Acad.lsp
Can anybody remember the Acad.lsp file? Now that there are MNL files and Acaddoc.Lsp, Acad.Lsp
would seem to be redundant. Well not really. The Acad.Lsp file is great for ensuring that partial menu's
are loaded.
So, want to ensure your custom menu/menu's, including pulldowns, are loaded
everytime AutoCAD is opened? Copy and paste this into your Acad.Lsp file
substituting your menu name where applicable :
(defun MYSTARTUP ( );;;replace this line with the following if you are using R2000
;;;(defun-q MYSTARTUP ( )
;suppress dialogues
(setvar "FILEDIA" 0)
;un-suppress dialogues
(setvar "FILEDIA" 1)
);progn
);progn
);if
);progn
);if
);if
;finish clean
(princ)
);defun
Please ensure that all "MYMENU" menu files are in your AutoCAD search path.
Listing Symbols
The following will give you a list of all entries in a symbol table. This is
great for creating a list to populate a list box in DCL.
(defun tablelist (s / d r)
(while
(setq d (tblnext s (null d)))
(setq r (cons (cdr (assoc 2 d)) r))
);while
);defun
For example, if you would like a list of all layers in a specific drawing,
use this :
(start_list "selections")
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp Links
If you would like to have an AutoCAD or AutoLisp Link added
to this site, then please send details using the Contribution Form.
● Tutorials/Forums ● VBA/VB
❍ AfraLisp Tutorials. ❍ Vbcad.
❍ VBA Expresso ❍ VB Design.
❍ CAD Encoding ❍ ActiveCAD.
❍ AutoCAD/AutoLisp Tutorials. ❍ Contract CADD Group.
❍ Cadd Standards. ❍ AcadX.Com
❍ AutoLisp Programming. ❍ VB Free Code
❍ Intervision ❍ VB Code
❍ AUGI ❍ CopyPaste Code
❍ AugAfrica
❍ AutoCAD User Groups
http://www.afralisp.com
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Daily Cartoon
by Ted Goff
www.newslettercartoons.com
This license grants non-exclusive electronic rights to the use of Ted Goff's daily cartoon at no charge to
Kenny Ramage for use on http://www.afralisp.com or any web page on that domain.
Ted Goff
PO Box 22679
Kansas City, MO 64113
18/08/2003
Yesterday's cartoon go
See cartoons about:
Cartoons for your Presentations and Newsletters.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
New!! You can now download all 3 books PLUS the AfraLisp Newsletters in one installation file. To
do so, just click here. ( 5227 kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp Routines
Click Here for some Other AutoLisp Routines
All Tutorials and Code are provided "as-is" for purposes of instruction and
utility and may be used by anyone for any purpose entirely at their own risk.
Please respect the intellectual rights of others.
All material provided here is unsupported and without warranty of any kind.
No responsibility will be taken for any direct or indirect consequences
resulting from or associated with the use of these Tutorials or Code.
Note : All files must be unzipped to C:/AFRALISP/STEEL/ and all directory structures must be
maintained.
Contents :
C_PFC
● Parallel Flange Channels PFC
C_RSC
● Tapered Flange Channels RSC
E_Angle
● Equal Angle Legs EA
U_Angle
● Unequal Angle Legs UA
U_Beam
● Universal Beams UB
U_Col
● Universal Columns UC
Joist
● Tapered Flange Joists RSJ
H_Sect_C
● Circular Hollow Sections CHS
H_Sect_R
● Rectangular Hollow Sections RHS
Form_C
● Formed Channels FC
Form_CL
● Formed Lipped Channels FLC
Form_A
● Formed Angles FA
Form_AL
● Formed Lipped Angles FLA
Panzoom (4Kb)
One technique used for fast viewing of drawings is to divide the drawing into regions.
You can then quickly zoom into those regions. This application uses an AutoLisp routine
and a toolbar to automate the viewing of your drawing in four regions. The four regions
are always based on the current limits of the drawing.
1. Copy the files Panzoom.lsp, Panzoom.mnu and Panzoom.dll to any directory within the
AutoCad support path.
2. Open AutoCad.
3. Load the partial menu file Panzoom.mnu.
The four directional arrows represent each quarter of the drawing. The AutoLisp routine
will automatically be loaded and run when you select one of the directional arrows.
This routine will Batch Convert/Purge a directory of drawings AND all it's
sub-directories.
It will Batch Convert to:
R12, R13, R14, Template, DWF, DXF, BMP, and WMF.
It will Batch Purge :
All, Blocks, Dimstyles, Layers, Linetypes, Shapes,
Styles and Multilines.
This routine will break a circle and change either of the broken
sections to a different layer. I have it preset to layer 2 (Hidden Line),
but this can easily be changed to suit your needs. You will need to have
a line bisecting the circle at the two points where you want the circle to
be broken. The routine will snap to these two points and then ask you which
portion you wish to change.
Architectural Doors and Windows.(6 Kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Now add the following coding to the click event of the label :
'<- Coding Starts Here
Private Sub Label1_Click()
Dim nFile As Integer
'Write a temp file URL
nFile = FreeFile
Close #nFile
'Launch the browser
Shell "rundll32.exe shdocvw.dll,OpenURL " & "\temp.url", vbNormalFocus
Kill "\TEMP.URL"
End Sub
Control Template
Ever get tired of making an exit button over and over? Do you use the same set up for multi
page (or any control) over and over? Save time, save effort. Make a control template!
1) Start with a New VBA Project in AutoCAD (or any VBA enabled application)
2) Add a UserForm to the project
Did you know that you can run VBA statements from the command line?
Try this:
1. VBASTMT <enter>
2. ThisDrawing.PurgeAll <enter>
CD Rom Drive
Let VB determine if the CD Rom drive contains media.
To quickly determine if the CD Rom drive contains media, use the Scripting Runtime library's IsReady
property for the Drive object.
For CD Rom drives, this property returns True only if the drive contains the appropriate media. To
take advantage of this handy property, add a Reference to Microsoft Scripting Runtime library
(scrrun.dll). Next, create a Drive variable based on the CD Rom drive, and test the IsReady property, as
shown below :
Dim FSO As FileSystemObject
Dim CDDrive As Drive
Type-Declaration Characters
In addition to declaring a variable as its explicit data type,VB also lets you declare certain
data types using a single type-declaration character.
For example, instead of using :
Load object(index)
where object is the name of the control array, and index is the index number of the new control you
want to add. In order to add controls to a control array at runtime, however, you must have at least one
control already in the array, (with it's index property set-most likely to 0). VB only allows 32,767
controls in an array.
For example, suppose you have a form with a button control array named cmdBtn. On the button's
Click event, you want to add another button to the form. To illustrate, open a new project and add a
command button to the default form. In the Properties Window, enter 0 for the control's Index. When
you do, VB transforms the button into a control array. Now, add the following code to the form:
End Sub
To do so, use a form, or project level, variable to keep track of how many times the Timer event fires.
Then, in the Timer event, re-enable the control if enough time hasn't passed. For example, consider the
code below that we attached to a standard form.
Option Explicit
Dim iElapsedMin As Integer
Const cMax_Min As Integer = 2
Highlight Text.
When you display a form, it's nice to highlight the text in a particular text box
so that the user does not have to delete the existing text before typing in his
new text string. Here's the coding :
**************************************************************************
UserForm1.TextBox1.SetFocus
'set focus to the textbox
UserForm1.TextBox1.SelStart = 0
'start at the first character
UserForm1.TextBox1.SelLength = Len(UserForm1.TextBox1.Text)
'highlight the text string
End Sub
*********************************************************************
*******************************************************************
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
CommandButton1_Click
End Sub
*******************************************************************
Private Sub CommandButton1_Click()
'Your coding goes here..............
End Sub
********************************************************************
Format Numbers.
Here's a quick tip that allows you to set the number of leading zeros, or to round to a certain
decimal point. Let's say you want to print '1.234000' in '001.234' format. To do this, use :
format(1.234000,"000.######")
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The products referenced in this site are provided by parties other than AfraLisp.
AfraLisp makes no representations regarding either the products or any information about the products.
Any questions, complaints, or claims regarding the products must be directed to the appropriate Author.
File Listing.
Watson. (116 kb).
The downloadable LISP is called Format Solview Layers or FSL. For those of you using AutoCAD
R14 - 2002 to do 3D, the solview command is critical to this process. However, it creates layers "on
the fly". This creates a problem from a standardization point of view for a company, because you
cannot use pre-defined templates for standard layer colors, linetypes, etc. This program will search
for the created layers and format them to predefined or custom standards.
I welcome any comments about the program. I know it's a little rough around the edges (especially
in the interface and error handling areas) but I took it as far as I could in the time I had.
-----------------------------
Andrew Levan
Project Engineer
Marsden, Inc.
Email: [email protected]
Below is a list of general purpose routines that I have written over the past year or so, most have
been written as part of other, more specific routines that I have written, I have included all of the
routines that are contained in the VLX file, although some may be similar to routines already
featured on this site.
These functions should all work correctly, but containing only minimal error checking
2 (rad->deg angle): input angle in radians as a real or int, returns angle in degrees as real
eg (setq a (rad->deg (/ pi 2.0))) = 90
7 (2d->3d 2d point level) returns a 3d point with z value equal to level or 0.0 if nil
eg (setq a (2d->3d '(0 0) 0)) = (0 0 0)
8 (stringp val): input a value, returns true if value is a string else nil
eg (stringp "Hello") = true
15 (strl_sort list): input list of strings, similar to (acad_strlsort) but sorts numbers
numerically
eg (strl_sort '("b" "a" "10" "1")) = ("1" "10" "a" "b")
16 (remove atom list): similar to (vl-remove) but only removes first occurance of atom in list
eg (remove 1 '(1 1 2 1)) = (1 2 1)
19 (sublist start length list): returns a number of elements after start position from a list
eg (sublist 1 2 '(1 2 3 4 5)) = (2 3)
20 (remlist start length list): removes a number of elements after start position from a list
eg (remlist 1 2 '(1 2 3 4 5)) = (1 4 5)
21 (list->string delim list): input deliminator as string, list, converts elements of list to a
deliminated string
eg (list->string "*" '("1" "2")) = "1*2"
24 (rtrim string): input string, removes any spaces from the end of the string
eg (rtrim " trim ") = " trim"
25 (trim string): input string, removes spaces from beginning and end of string
eg (trim " trim ") = "trim"
26 (string->list string): input string, returns the string a list using spaces a delimineater
eg (string->list "Hello World") = ("Hello" "World")
27 (mid string string): input two strings, returns first string if it is found within second string
else nil
eg (mid "to" "AutoCAD") = "to"
32 (multiline string int): returns string as a list of strings, each element being no longer than
int but finishing with a full word if possible
eg (multiline "Hello New World" 3) = ("Hel" "lo " "Wor" "ld")
33 (stringcase string int): changes string case 0 or nil Upper Case, 1 Lower Case, 2 Initail
Character Upper Case rest Lower
eg (stringcase "hello world" 2) = "Hello World"
If you have any comments or suggestions as to improvements please contact me - Michel Loftus
Written By : [email protected]
IDECLARE searches given LISP source file(s) for undeclared local variables and declares any such
found. Any new declares made are flagged with a comment.
Global variables are recognized by having a '#' (number sign) as the first
character. The original LISP input file will be renamed with the file extension
ORG. Wildcard characters '*' and '?' can be used in the LISP input file name.
The global variable identifying character can be changed by giving the new
identifying character as the second parameter on the command line, after the
file name. A new file extension for the original LISP input to be saved under
can be given as the third command line argument.
Roughen (4 kb).
Flatten (4 kb).
A block manager with an INI style customization file and a dialog box, performing
collection-grouping, file path display, and slide previews as 'hot thumbnails'.
Build your own dwg block library with it, and make them ready to be inserted
easily, anytime.
Created by Lintang Darudjati :
...Lintang Lives Here...
[email protected]
A small program for AutoCAD users. It fixes layer colors for plotting purposes
(via a dialog box) by assigning layer colors to an INI-style config file that
matches specific pen settings.
Created by Lintang Darudjati :
...Lintang Lives Here...
[email protected]
3.0 TRIM: Trims spaces from leading and trailing end of text.
e.g. (setq a (trim " text ")) sets variable 'a' to "text".
This routine is pretty much like the Distance command with the
exception that it allows you to pick more than two points.
The routine displays the cumulative distance of all those
points picked. As you are picking the points it also displays a
running total and the distance between the last two points picked.
This program will calculate standard lengths of bolts. It allows for 2 washers,
nut, and 4 pitches of thread after the nut.
Spring washer is optional. It will draw the bolt assy and individual components
as polylines after picking 2 points.
Fastener.dcl and Fastener.lst are used with this program.
Well done Peter, you're where the first on this page...
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
There are three major API's with which you can extend AutoCAD. They are respectively: a C/C++ api called
objectARX, a VB/VBA api, and an AutoLisp/VisualLisp api. Every developer has their favorite but all partiality
aside people often wonder which is better, which should I use? The answer to those questions is: "It depends on
what you need to accomplish". Each API has different things, which make it better in given situations. When
deciding on which API to use there are 4 things you need to ask yourself. What language am I most comfortable
in? How much time do I have? Who is the target user and how much AutoCAD experience do they have? How
much control over AutoCAD and possibly Windows do I need to accomplish the task quickly? After I address
some of the functionality of the different API's you will see why these are relevant. I am only going to deal with
these API's as they apply internally to AutoCAD not as stand alone applications.
Here is a simple checklist for determining which API may be right for your project:
ObjectARX:
● You are most comfortable working in C or C++
● You need the absolute maximum amount of control over AutoCAD and Windows
● You need to write custom objects
● You need access to things which are not exposed to VBA or Lisp
● You require more speed than can be had using VBA or Lisp
● Your workplace requires applications be developed in C or C++
● You need to use libraries external to AutoCAD which are only available to C or C++
VBA:
● You are most comfortable working in VBA
● You require maximum speed of development time yet are not overly worried about application speed
● You know you are going to need a lot of help from Autodesk getting your application written
Lisp:
● The world ended and there are no other tools available
● You are most comfortable working in Lisp
● You are working with an AutoCAD version prior to 2000
● You are working in one of those gray areas in AutoCAD where Lisp can do something that would require a
huge amount of VB knowledge to accomplish the same thing.
● You don't need any dialogs or graphical user interaction other than the command line/screen pics in your
application
● Parens make you happy (oh look here come the men in white coats for you now)
Now I will provide what you all come here for really. Free code. Yes, that's right we know that's why you really
read this stuff isn't it. So since you suffered through the above I suppose I shall have to reward you with free code
so that you come back. In each of the three API's I show a way to edit the first editable attribute in a block
reference. The use of "command" will not be seen here as that is a huge pet peeve of mine. If you are using
"command" you are not programming you are scripting and they are two completely separate things.
ObjectARX:
void chngAtt()
{
ads_name entres;
ads_point ptres;
AcDbObjectId _Id, _attId;
AcDbObjectIterator *pIttr = NULL;
if(acedEntSel("Select a Block Reference", entres, ptres) != RTNORM )
{
//Selection failed
return;
}
acdbGetObjectId(_Id, entres);
AcDbObjectPointer pRef(_Id,AcDb::kForRead);
if(pRef.openStatus()!=Acad::eOk)
{
//Open failed
return;
}
pIttr = pRef->attributeIterator();
while(!pIttr->done())
{
_attId = pIttr->objectId();
AcDbObjectPointer pAtt(_attId,AcDb::kForWrite);
if(pAtt.openStatus()==Acad::eOk)
{
pAtt->setTextString("We changed this");
break;
}
pIttr->step();
}
delete pIttr;
}
VBA:
Option Explicit
Sub chngAtt()
Dim objEnt As AcadObject
Dim objRef As AcadBlockReference
Dim varAtts As Variant
Dim objAtt As AcadAttributeReference
Dim emptyPt As Variant
End Sub
Lisp:
(defun C:chngAtt ()
(setq Mainent (entsel))
(setq entList (entget (car Mainent)))
(setq entAtt (entget (entnext (cdr (assoc -1 entList)))))
(setq entNewAttVal
(subst (cons 1 "We changed this") (assoc 1 entAtt) entAtt)
)
(entmod entNewAttVal)
(entupd (car Mainent))
(princ)
)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
If Visual Basic is the first experience you, as a programmer, have had with 'event driven'
programming, then read on and enter the world of Visual Basic..........
Although objects in VBA automatically recognize a predefined set of events, you determine if and
how they respond to a particular event. When you want a control to respond to an event, you write
code called an event procedure for that event.
Many objects recognize the same event, although different objects can execute
different event procedures when the event occurs. For example, if a user clicks
a userform, the Userform_Click event procedure executes; if a user clicks a command button
named CommandButton1, the CommandButton1_Click event procedure executes.
Here's what happens in a typical event driven application:
1. The application starts and a form or control receives an event. The event can be caused by the
user (for example a keystroke), or by the system (for example a timer), or indirectly by your
code (for example, a Load event procedure when your code loads a form.
2. If there is an event procedure corresponding to that event, it executes.
3. The application waits for the next event.
Note : Many events occur in conjunction with other events. For example, when the DblClick event
occurs, the MouseDown, MouseUp and Click events also occur.
In event driven programmes, a user action or system event executes an event procedure.
Thus, the order in which your code executes depends on which events occur, which in turn depends
on what the user does. This is the essence of graphical user interfaces and event driven
programming: The user is in charge, and your code responds.
Because you can't predict what the user will do, your code must make a few assumptions about 'the
state of the world' when it executes. When you must make assumptions (for example, that a text box
has text in it before a command button is pressed), you should try to structure your application so
those assumptions are always valid (for example, disabling the command button and enabling it
only in the Change event procedure for the text box).
Your code might trigger additional events as it performs additional operations. For example,
loading a Userform causes the Userforms Load event to occur, and changing the Text property of a
text box causes the text box's Change event to occur.
Objects.
Each object in VBA is defined by a 'class'. To understand the relationship between an
object and it's class, think of cookie cutters and cookies. The cookie cutter is the class. It
defines the characteristics of each cookie - for instance, size and shape. The class is
used to create objects. The objects are the cookies.
Two examples of the relationship between classes and objects in VBA may make this clearer.
● The controls on the Toolbox in VBA represent classes. The object known as a control doesn't
exist until you draw it on a Userform. When you create a control, you're creating a copy or
'instance' of the control class. That instance of the class is the object you refer to in your
application.
● The Userform you work with at design time is a class. At runtime, VBA creates an instance of
the Userforms class.
All objects are created as identical copies of their class. Once they exist as
individual objects, their properties can be changed. For example, if you draw three command
buttons on a Userform, each command button object is an instance of the CommandButton class.
Each object shares a common set of characteristics and capabilities (properties, methods and
events), defined by the class. However, each has it's own name, can be separately enabled and
disabled, can be placed in a different location on the form, and so on.
Radio.Volume = 5
Objects also have events. Events are triggered when some aspect of the object is changed. For
example, a radio might have a 'VolumeChange' event. A telephone might have a 'Ring' event.
As it would be an impossibility for me to try and explain to you all the characteristics of VB, I
strongly urge you to invest in a good VB reference book. There are many on the market and it
would make your life a whole lot easier.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
VBA Primer.
I have had numerous requests from people asking for a tutorial on Visual Basic
for Applications. Well here it is. This tutorial will take you from the very basics
of opening the Visual Basic Editor to building a simple application.
I must stress though, that Visual Basic is a language with thousands of built in functions
and numerous custom modules and controls available. I strongly recommend that you
invest in a good Visual Basic book as I cannot possibly take you through the whole VB
language. Also, remember that AutoCAD Visual Basic for Applications is a subset of the
Visual Basic language with it's own build in functions and controls.
Anyway, enough warbling for now, let's get started with our application.
This application called, Change Layer, will allow you to change the layer of
any entity within your drawing. It will display a dialogue box with a list box
listing all of the available layers in your drawing. After you have selected
a layer to change to, it will prompt you to select the entities you would like
to change to that layer and then change them. Sound's good hey! Here we go...
Fire up AutoCAD and choose 'TOOLS-MACRO-VISUAL BASIC EDITOR' from the pull-down
menu.
The Visual Basic Editor should appear and will look like this:
Don't worry about the various windows that appear in the editor. We will go through each one as
we progress through this tutorial.
This is the form that we will use to create our dialogue box from.
Now look in the top left hand corner of the screen. There you will find the Project dialogue. This
basically lists all the Forms, Modules, etc. that are part of your VBA project.
As you can see, because we haven't named our project yet, AutoCAD gives our
project the name Project.dvb. Before we go any further let's save our project
and give it a name. Select 'FILE-SAVE' from the menu bar and name the project
'Chlayer.dvb'. Also you will be able to see the form that we created listed
under Forms and given the default name of UserForm1. All forms, modules and
controls that you insert into your project will be given a default name. (You
can, if you wish change it later but, in this exercise we will only work with
the default names.)
Now, let's have a look at the Properties dialogue box. This you will find in
the lower left-hand corner of the Editor and should look like this:
This dialogue lists all the properties that an object has. The dialogue should
show all the properties available for the form, UserForm1 that you inserted.
If it doesn't, click on the form to select it.
The first property listed is (Name) - UserForm1. This is the property that
you would change if you wanted to change the name of the form. Please remember, that this is the
name that you use to programatically refer to this particular form. If you change this name once
you have written code referring to this form, you will have to manually change all the instances of
that name in your code.
Let's change the caption of the form. Select the caption property and change it
from 'UserForm1' to 'Change Layer'. Your form should now look like this :
Notice how the caption has changed. On the next page we will have a look at
adding controls to our form. See you there.........
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
To add a control to your form, select the desired control and click on the form
in the position that you would like the control to be. Select the CommandButton control (2nd row,
far right) and place it on your form.
Your form should now look like this :
The Caption property is, of course, the text that appears within the button.
The Default property means that if Enter is selected the event procedure asSigned to this control is
triggered.
The Accelerator property is the letter of the caption that needs to be selected,
along with the Ctrl key, to select this control.
Now add the following controls to your form and changed the properties to the
values listed below :
Command Button
(Name) CommandButton2
Cancel True
Caption Cancel
Accelerator C
Font Arial - Bold - Size 8
The Cancel property means that if Esc is selected the event procedure assigned to this control is
triggered.
Label
(Name) Label1
Caption Choose Layer:
Font Arial - Bold - Size 8
List Box
(Name) Listbox1
Font Arial - Bold - Size 8
BackColor Yellow
You can move a control by simply dragging and dropping it. To re-size it, just
grip the re-size boxes at the edges and corners of the control.
Now move and re-size your controls and the form until the dialogue box looks
similar to this :
Note: Do you see how easy it is to create dialogue boxes in VBA compared
to DCL. "What a pleasure!!!"
Now that we have got our basic dialogue box we need to make it do something.
Page III, look out, here we come...........
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This is the code window were you will be writing all of your Visual Basic Code.
If you look at the Project window you will find that a new Module has been created and has been
given the default name of Module1.
Now enter the following code into the module :
sub chlayer ()
'name of function
UserForm1.Show
'display the dialogue box
'UserForm1
End Sub
Thw code window should look like this :
As you have probably worked out for yourself, any line starting with a ' is a comment. (The same as
the ; in AutoLISP).
Visual Basic also colour codes the coding but I am not going to get into that
at this time.
Next, double click on the Cancel button on UserForm1. The code window will open again,
displaying the Click Event procedure for that control.
Type in the following code :
End
'end the programme
End Sub
The code window should look like this :
This sub-routine simply ends the programme if the Cancel button is selected.
Now, let's test our dialogue box.
(This would be a good time to save your project......)
Return to AutoCAD and select TOOLS - MACROS - RUN MACRO from the menu bar.
The following dialogue should appear:
Choose 'Module1' from the list box and 'chlayer' from the drop down list box.
Now select 'Run'. Your dialogue should appear in all it's glory.
(Thunderous applause from the audience.)
Once you have finished admiring your handywork select 'Cancel'.
We still have a couple of problems though. Firstly, there is nothing in the
list box and the OK button doesn't work.
On the next page we'll show you how to populate the list box with all the
layer names in your drawing and then we'll write the main event procedure for
the O.K. button.
While you are waiting for the next page you might as well grab yourself a beer.
I've got one.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
ListBox1.AddItem Layer.Name
'add the layer name to the list box
Next
'carry on looping
End Sub
A list of all the layers in any drawing are kept in the Layers collection.
This coding is telling Visual Basic that when the form is initialized, get all of the layer names from
the layers collection, and add them to the list box.
Run the program again. Your dialogue should now look like this :
Now let's look at the coding for the OK button event procedure.
Me.Hide
'hide the dialogue box
Set ss = ThisDrawing.SelectionSets.Add("NEWSS")
'create a selection set reference
ss.SelectOnScreen
'select the objects to change
Entity.Layer = ListBox1.Text
'change the layer to the layer name
'selected in the list box
Next
'process the next entity
End
'end the programme
End Sub
Now run the programme again. Select a layer from the list box and then select
some objects on your drawing. They should change to your selected layer.
Well I hope this has given you a bit more of an idea what VBA is all about.
The application is far from perfect. There is no error checking and the items
in the list box have not been sorted. Maybe that is something that you could
work on now that you have had a taste of VBA. Have a look at the other sample
applications in this section. They cover large areas of VBA and all come complete with source
coding. All the best and good luck with VBA......
If you would like to download this VBA Primer, stand on your head, say 'Yes Please' in
French, place your mouse here and Click. Enjoy.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Userforms.
If you have programmed with AutoLisp and the Dialogue Control Language (DCL), you will
be familiar with designing dialogue boxes. Compared to DCL though, designing dialogue
boxes in VBA is a breeze. The basis of all dialogue boxes in VBA is the Userform. This
Tutorial will show you how to display and manipulate Userforms.
A Userform is a container that holds all the controls such as labels, textboxes,
pictures, etc. that make up part of your applications interface.
A Userform has it's own Properties, Methods and Events. Let's have a look at some of them :
Displaying a Userform
The syntax for displaying a Userform is as follows :
UserFormName.Show
So, to display a Userform named Userform1, you would use the following code:
Userform1.Show
If you want to, you can preload the Userform into memory without actually displaying it. This can be
useful as it can sometimes take a few seconds for a complex Userform to appear. The ability to
preload the Userform allows you to decide when you would like this operation to take place. To
preload a Userform you would use the following code :
Load Userform1
Hiding/Unloading a Userform
To temporarily hide a Userform, you would use the Hide method. This is a very good example of how
dialogue boxes in VBA are so much simpler than in AutoLisp. To hide a Userform you would use the
following code:
Userform1.Hide
To Unload a Userform from memory use the following code :
Unload Userform1
You could also use the 'Me' keyword :
Unload Me
Useform Events
Userforms support many predefined events. Among the most commonly used events are Initiliaze,
Click and Terminate events.
Note A VBA module that contains an event procedure can be called a module
'behind' the Userform. A module that contains event procedures is not visible in the Modules
collection of the Projects window of the VBA Editor. You must double-click the body of the Userform
to view the Userform Code Module.
Let's have a look at some Userform Events. Start your VBA Editor and insert a
Userform into a new Project. Double-Click the Userform and type in the following code:
Private Sub UserForm_Click()
Me.Height = Int(Rnd * 500)
Me.Width = Int(Rnd * 750)
End Sub
End Sub
End Sub
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Lisp to VBA.
To demonstrate the use of VBA in AutoCAD, I've taken a few of the more common
AutoLisp routines, and converted them to VBA Applications.
This will hopefully help the AutoLisper who is trying to migrate from AutoLisp To VBA.
These routines should be familiar to most AutoLispers and by having a good
understanding of how the routine is written in AutoLisp, you should find it very easy to
follow and undestand the VBA logic and coding.
Note:
I have presumed that you know how to load and run a VBA Application, work with User Forms
and controls, and know how to set the basic Properties of UserForms and Controls. The only
Properties that I have listed are those that are out of the norm.
I have NOT included any error checking for the sake of readability.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Slotted Holes.
This application will draw slotted holes as per the above diagram.
It begins by asking the user for an insertion point, the slot length, and then the slot diameter using
the VBA Get functions.
It then uses the PolarPoint function to calculate the other points required to draw the slot. Then,
using the AddLine and AddArc command, it draws the
slotted hole.
Note how we declare 'pi' as a Constant and construct a function to convert Degrees to Radians.
Open a new module and add this coding to it :
Const pi = 3.14159
'create Pi as a constant
'This function converts Degrees to Radians Function dtr(a As Double) As Double dtr = (a / 180) * pi
End Function
Sub Slot() 'define the function Dim InsertPoint As Variant Dim SlotLength As Double Dim SlotDia
As Double Dim Prompt1 As String Dim Prompt2 As String Dim Prompt3 As String Dim pt1 As
Variant Dim pt2 As Variant Dim pt3 As Variant Dim pt4 As Variant Dim pt5 As Variant Dim pt6
As Variant Dim pt7 As Variant Dim LineObj As AcadLine Dim ArcObj As AcadArc 'declare all
variables Prompt1 = vbCrLf & "Insertion Point : " 'store the prompt InsertPoint =
ThisDrawing.Utility.GetPoint(, Prompt1) 'get the insertion point Prompt2 = vbCrLf & "Slot
Length : " 'store the prompt SlotLength = ThisDrawing.Utility.GetReal(Prompt2) 'get the slot
length Prompt3 = vbCrLf & "Slot Diameter : " 'store the prompt SlotDia =
ThisDrawing.Utility.GetReal(Prompt3) 'get the slot diameter pt1 = ThisDrawing.Utility. _
PolarPoint(InsertPoint, dtr(270#), SlotDia / 2) pt2 = ThisDrawing.Utility. _ PolarPoint(pt1,
dtr(180#), SlotLength / 2) pt3 = ThisDrawing.Utility. _ PolarPoint(pt2, dtr(90#), SlotDia) pt4 =
ThisDrawing.Utility. _ PolarPoint(pt3, dtr(0#), SlotLength) pt5 = ThisDrawing.Utility. _
PolarPoint(pt4, dtr(270#), SlotDia) pt6 = ThisDrawing.Utility. _ PolarPoint(InsertPoint, dtr(180#),
SlotLength / 2) pt7 = ThisDrawing.Utility. _ PolarPoint(InsertPoint, dtr(0#), SlotLength / 2)
'calculate all the points using the PolarPoint Function Set LineObj = ThisDrawing.ModelSpace. _
AddLine(pt1, pt2) Set LineObj = ThisDrawing.ModelSpace. _ AddLine(pt3, pt4) Set LineObj =
ThisDrawing.ModelSpace. _ AddLine(pt5, pt1) Set ArcObj = ThisDrawing.ModelSpace. _
AddArc(pt6, SlotDia / 2, dtr(90), dtr(270)) Set ArcObj = ThisDrawing.ModelSpace. _ AddArc(pt7,
SlotDia / 2, dtr(270), dtr(90)) 'Draw the Slotted Hole End Sub
Now, let's add a dialogue box to our application to streamline the user input :
ScrollBar Properties :
● Max = 100
● Min = 1
● Value = 50
● SmallChange = 1
● LargeChange = 5
TextBox1 :
● Value = 50
TextBox1 :
● Value = 20
Now, under the Click Event for CommandButton1, add this coding :
Private Sub CommandButton1_Click()
Dim InsertPoint As Variant
Dim SlotLength As Double
Dim SlotDia As Double
Dim Prompt1 As String
Dim pt1 As Variant
Dim pt2 As Variant
Dim pt3 As Variant
Dim pt4 As Variant
Dim pt5 As Variant
Dim pt6 As Variant
Dim pt7 As Variant
Dim LineObj As AcadLine
Dim ArcObj As AcadArc
'declare all variables
SlotLength = TextBox1.Value
'retrieve the Slot Length
SlotDia = TextBox2.Value
'retrieve the Slot Diameter
UserForm1.Hide
'hide the dialogue box
pt1 = ThisDrawing.Utility. _
PolarPoint(InsertPoint, dtr(270#), SlotDia / 2)
pt2 = ThisDrawing.Utility. _
PolarPoint(pt1, dtr(180#), SlotLength / 2)
pt3 = ThisDrawing.Utility. _
PolarPoint(pt2, dtr(90#), SlotDia)
pt4 = ThisDrawing.Utility. _
PolarPoint(pt3, dtr(0#), SlotLength)
pt5 = ThisDrawing.Utility. _
PolarPoint(pt4, dtr(270#), SlotDia)
pt6 = ThisDrawing.Utility. _
PolarPoint(InsertPoint, dtr(180#), SlotLength / 2)
pt7 = ThisDrawing.Utility. _
PolarPoint(InsertPoint, dtr(0#), SlotLength / 2)
'calculate all the points using the PolarPoint Function
End Sub
End Sub
If you would like to download the source code for this Application/s, Then click Here
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Muliple Offset.
This application will offset an entity multiple times. Just select the entity, enter an offset
distance, (enter a negative number if you want to offset the other way), and then enter the
number of times you would like to offset it.
Enter this coding into a new module :
Option Explicit
offsetObj = objPicked.Offset(returnDist)
'offset the object
For i = 1 To nuOffsets
'set up the loop
offsetObj = objPicked.Offset(accumDist)
'multiple offset the object
Next i
'loop
End Sub
Now run the macro 'Moffset'. Works fine Hey!. Now run it again but this time select an empty
space on the screen when prompted to select an object.
Oh, Crikey, an error??? Re-run it once more but this time select an object.
Now press the Escape key. Oh No, another error!!!
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Note : Please ensure that all the files are in the same directory and within
your AutoCAD support path. Thanks :-))
You will need to create a new form with 2 list boxes and 3 buttons.
Keep the default names. Now create a new form and add this coding :
Option Explicit
Lname = objLayer.Name
'get the layer name
Next
Close #1
'close the file
Unload Me
'unload dialogue
End Sub
ListBox2.Clear
'clear the listbox
ListBox2.AddItem sTemp
'add it to the list box
Wend
Close #1
'close the file
End Sub
ListBox1.AddItem objLayer.Name
'add them to the list box
Next
End Sub
Sub EILayer()
UserForm1.Show
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Filtering Layers.
Ever wondered how to filter your drawing for specific layers?
Well here's how. This application will filter your drawing for a specific layer using the
criteria that you will provide from within a sub-routine.
First of all the Function. Open a new module and add this coding :
Option Explicit
intCode(0) = 8
'set variable for the dxf code for layer
varData(0) = strLayerName
'set variable for the layer name
End Function
Now add the sub-routine to run the function to the same module :
Public Sub FilterLayer()
Dim ssLayrObj As AcadSelectionSet
'declare variables
obj.Highlight True
'highlight them
Next
ThisDrawing.SelectionSets.Item("vbdset").Delete
'delete the selection set
End Sub
Run the macro "FilterLayer". All the entities on Layer 0 should be highlighted.
Now you've got them, you can do anything you like with them.
But that, I will leave to your imagination.......
I would just like to thank Randall Raath for allowing me to 'steal' this.
(Saved me a lot of typing!!!!).
If you would like to download the source code for this Application/s, then click Here
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Note : This will only work with Line Text. Sorry :-(
Now insert a userform with a text box and two buttons. Keep the default
names and add this coding to the form :
End If
objPicked.TextString = TextBox1.Text
objPicked.Update
'update the text
End
End Sub
Now run the macro "TextEdit" and select some line text when prompted.
Change the text and select O.K. Crikey, I'm good hey!!!!
If you would like to download the source code for this Application/s, then click Here
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Change Text.
This application will change the Height, Layer, Style or Colour of selected text within a
drawing. You can use the 'Select Objects' button to select any objects on screen by
using any of the standard AutoCAD selection methods, or you can choose 'Select All' to
select all text entities. The application will automatically filter out all non-text entities.
TextBox1.Enabled = True
UserForm1.TextBox1.SetFocus
'set focus to the textbox
UserForm1.TextBox1.SelStart = 0
'start at the first character
UserForm1.TextBox1.SelLength = Len(UserForm1.TextBox1.Text)
Else
TextBox1.Enabled = False
End If
End Sub
ComboBox1.Enabled = True
Else
ComboBox1.Enabled = False
End If
End Sub
ComboBox2.Enabled = True
Else
ComboBox2.Enabled = False
End If
End Sub
ComboBox3.Enabled = True
Else
ComboBox3.Enabled = False
End If
End Sub
UserForm1.Hide
'hide the dialogue
gpCode(0) = 0
'set the filter DXF code
gpValue(0) = "TEXT"
'set the filter DXF value
FilterEnt.Height = TextBox1.Text
End If
'retrieve the height
FilterEnt.Layer = ComboBox1.Text
FilterEnt.Color = acByLayer
End If
'retrieve the layer
FilterEnt.StyleName = ComboBox2.Text
End If
'retrieve the style
FilterEnt.Color = ComboBox3.Text
End If
'retrieve the color
FilterEnt.Update
'update the entity
Next FilterEnt
ThisDrawing.SelectionSets("TEMP").Delete
'delete the selection set
End
End Sub
End
End Sub
FilterType(0) = 0
'set the filter DXF code
FilterData(0) = "TEXT"
'set the filter DXF type
UserForm1.Hide
'hide the dialogue
FilterEnt.Update
Next FilterEnt
ThisDrawing.SelectionSets("TEMP").Delete
'delete the selection set
End
End Sub
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
'switch off all checkboxes
TextBox1.Text = ThisDrawing.GetVariable("TextSize")
'retrieve the current text height
ComboBox1.Text = ThisDrawing.GetVariable("CLayer")
'retrieve the current text style
ComboBox2.Text = ThisDrawing.GetVariable("TextStyle")
'retrieve the current text style
ComboBox1.AddItem objLayer.Name
'add them to the list box
Next
ComboBox2.AddItem objStyle.Name
'add them to the list box
Next
For i = 1 To 255
'start the loop
ComboBox3.AddItem i
Next i
End Sub
Sub Chtext1()
UserForm1.Show
End Sub
To run this application run the macro "Chtext1".
There is one thing wrong with this application. The list of Layers and Styles are not sorted. I didn't
include the coding for this as it would have complicated the issue. Therefore, I have included
another version of this application within the zip file that includes the sort coding. (Many thanks to
Randall Raath.)
If you would like to download the source code for this Application/s, then click Here
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The following is a list of AutoCAD support files that can be edited. The support files are listed in
alphabetical order by file extension. Please make backup copies of these files before modifying them.
File Description
asi.ini Database connectivity link conversion mapping file.
acad.lsp A user-defined AutoLISP routine that loads each time you start AutoCAD.
acaddoc.lsp A user-defined AutoLISP routine that loads each time you start a drawing.
*.mnl AutoLISP routines used by AutoCAD menus. A MNL file must have the same file
name as the MNU file it supports.
*.mns AutoCAD generated menu source files. Contains the command strings and macro
syntax that define AutoCAD menus.
*.mnu AutoCAD menu source files. Contain the command strings and macro syntax that
define AutoCAD menus.
The AutoCAD program parameters file. Contains definitions for external commands
acad.pgp
and command aliases.
AutoCAD PostScript Support file; the master support file for the PSOUT and PSFILL
acad.psf
commands.
acad.rx Lists ObjectARX applications that load when you start AutoCAD.
AutoCAD script files. A script file contains a set of AutoCAD commands processed
*.scr
as a batch.
AutoCAD shape/font definition files. Compiled shape/font files have the extension
*.shp
.shx.
AutoCAD unit definition file. Contains data that lets you convert from one set of
acad.unt
units to another.
Following is a list of AutoCAD, Express Tools, and user-defined files in the order they are loaded when
you first start the program.
File For use by:
acad2000.lsp AutoCAD
acad.rx User
acad.lsp User
acad2000doc.lsp AutoCAD
acetutil.fas Express Tools
acaddoc.lsp User
mymenu.mnc User
mymenu.mnl User
acad.mnc AutoCAD
acad.mnl AutoCAD
acetmain.mnc Express Tools
acetmain.mnl Express Tools
s::startup User
Note: If the user-defined function S::STARTUP is included in the acad.lsp or acaddoc.lsp file or a MNL
file, the function is called when you enter a new drawing or open an existing drawing. Thus, you can
include a definition of S::STARTUP in the LISP startup file to perform any setup operations.
AutoCAD loads the contents of four user-definable files automatically: acad.rx, acad.lsp, acaddoc.lsp,
and the .mnl file that accompanies your current menu. By default, the acad.lsp loads only once, when
AutoCAD starts, while acaddoc.lsp loads with each individual document (or drawing). This lets you
associate the loading of the acad.lsp file with application startup, and the acaddoc.lsp file with document
(or drawing) startup. The default method for loading these startup files can be modified by changing the
setting of the ACADLSPASDOC system variable.
If one of these files defines a function of the special type S::STARTUP, this routine runs immediately
after the drawing is fully initialized. The S::STARTUP function is described in S::STARTUP
Function—Post-Initialization Execution. As an alternative, the APPLOAD command provides a Startup
Suite option that loads the specified applications without the need to edit any files.
The acad.lsp and acaddoc.lsp startup files are not provided with AutoCAD. It is up to the user to create
and maintain these files.
Because AutoCAD searches for the acad.rx file in the order specified by the library path, you can have a
different acad.rx file in each drawing directory. This makes specific ObjectARX programs available for
certain types of drawings. For example, you might keep 3D drawings in a directory called
AcadJobs/3d_dwgs. If that directory is set up as the current directory, you could copy the acad.rx file
into that directory and modify it in the following manner:
myapp1
otherapp
If you place this new acad.rx file in the AcadJobs/3d_dwgs directory and you start AutoCAD with that as
the current directory, these new ObjectARX programs are then loaded and are available from the
AutoCAD prompt line. Because the original acad.rx file is still in the directory with the AutoCAD program
files, the default acad.rx file will be loaded if you start AutoCAD from another directory that does not
contain an acad.rx file.
You can load ObjectARX programs from an .mnl file using the arxload function. This ensures that an
ObjectARX program, required for proper operation of a menu, will be loaded when the menu file is
loaded.
You can also autoload many ObjectARX-defined AutoCAD commands (see Command Autoloader and
"autoarxload" in the AutoLISP Reference).
The acad.lsp file is loaded at each drawing session startup when AutoCAD is launched from the
Windows desktop. Because the acad.lsp file is intended to be used for application-specific startup
routines, all functions and variables defined in an acad.lsp file are only available in the first drawing. You
will probably want to move routines that should be available in all documents from your acad.lsp file into
the new acaddoc.lsp file.
The recommended functionality of acad.lsp and acaddoc.lsp can be overridden with the
ACADLSPASDOC system variable. If the ACADLSPASDOC system variable is set to 0 (the default
setting), the acad.lsp file is loaded just once; upon application startup. if ACADLSPASDOC is set to 1,
the acad.lsp file is reloaded with each new drawing.
The ACADLSPASDOC system variable is ignored in SDI (single document interface) mode. When the SDI
system variable is set to 1, the LISPINIT system variable controls reinitialization of AutoLISP between
drawings. When LISPINIT is set to 1, AutoLISP functions and variables are valid in the current drawing
only; each time you start a new drawing or open an existing one, all functions and variables are cleared
from memory and the acad.lsp file is reloaded. Changing the value of LISPINIT when the SDI system
variable is set to 0 has no effect.
The acad.lsp file can contain AutoLISP code for one or more routines, or just a series of load function
calls. The latter method is preferable, because modification is easier. If you save the following code as
Note: Do not modify the reserved acad2000.lsp file. Autodesk provides the acad2000.lsp file, which
contains AutoLISP defined functions that are required by AutoCAD. This file is loaded into memory
immediately before the acad.lsp file is loaded.
Most users will have a single acaddoc.lsp file for all document-based AutoLISP routines. AutoCAD
searches for an acaddoc.lsp file in the order defined by the library path; therefore, with this feature, you
can have a different acaddoc.lsp file in each drawing directory, which would load specific AutoLISP
routines for certain types of drawings or jobs.
The acaddoc.lsp file can contain AutoLISP code for one or more routines, or just a series of load
function calls. The latter method is preferable, because modification is easier. If you save the following
code as an acaddoc.lsp file, the files mydocumentapp1.lsp, build.lsp, and counter.lsp are loaded every
time a new document is opened.
(load "mydocumentapp1")
(load "build")
(load "counter")
AutoCAD searches for an acaddoc.lsp file in the order defined by the library path; therefore, you can
have a different acaddoc.lsp file in each drawing directory. You can then load specific AutoLISP routines
for certain types of drawings or jobs.
Note: Do not modify the reserved acad2000doc.lsp file. Autodesk provides the acad2000doc.lsp file,
which contains AutoLISP-defined functions that are required by AutoCAD. This file is loaded into
memory immediately before the acaddoc.lsp file is loaded.
Compiled menu file. This binary file contains the command strings and menu syntax
MNC
that defines the functionality and appearance of the menu.
MNR Menu resource file. This binary file contains the bitmaps used by the menu.
Menu resource file. This file is generated when the MNR file is unavailable, for example,
MNT
read-only.
Menu LISP file. This file contains AutoLISP expressions that are used by the menu file
MNL
and are loaded into memory when a menu file with the same file name is loaded.
AutoCAD stores the name of the last loaded menu in the system registry. This name is also saved with
the drawing, but it is used only for backward compatibility. When you start AutoCAD, the last menu used
is loaded. As of Release 14, AutoCAD no longer reloads the menu between drawings.
AutoCAD finds and loads the specified file according to the following sequence. (This sequence is also
used when AutoCAD loads a new menu with the MENU command.)
● AutoCAD looks for a menu source file (MNS) of the given name, following the library search
procedure.
● If an MNS file is found, AutoCAD looks for a compiled menu file (.mnc) of the same name in the
same directory. If AutoCAD finds a matching MNC file with the same or later date and time as the
MNS file, it loads the MNC file. Otherwise, AutoCAD compiles the MNS file, generating a new MNC
file in the same directory, and loads that file.
● If an MNS file is not found, AutoCAD looks for a compiled menu file (.mnc) of the given name,
following the library search procedure. If AutoCAD finds the MNC file, it loads that file.
● If AutoCAD doesn't find either a MNS or a MNC file, it searches the library path for a menu
template file (.mnc) of the given name. If this file is found, it compiles an MNC and MNS file, then
loads the MNC file.
● If AutoCAD doesn't find any menu files of the given names, an error message is displayed and you
are prompted for another menu file name.
● After finding, compiling, and loading the MNC file, AutoCAD looks for a menu LISP file (.mnl),
using the library search procedure. If AutoCAD finds this file, it evaluates the AutoLISP
expressions within that file.
The acad.mnl file contains AutoLISP code used by the standard menu file, acad.mnu. The acad.mnl file is
loaded each time the acad.mnu file is loaded.
Each time AutoCAD compiles an MNC file it generates a menu resource file (MNR) which contains the
bitmaps used by the menu. The MNS file is an ASCII file that is initially the same as the MNU file (without
comments or special formatting). The MNS file is modified by AutoCAD each time you make changes to
the contents of the menu file through the interface (such as modifying the contents of a toolbar).
Although the initial positioning of the toolbars is defined in the MNU or MNS file, changes to the
show/hide and docked/floating status or changes to the toolbar positions are recorded in the system
registry. After an MNS file has been created, it is used as the source for generating future MNC, and MNR
files. If you modify the MNU file after an MNS file has been generated, you must use the MENU command
to explicitly load the MNU file so that AutoCAD will generate new MNS and MNC files and your changes
will be recognized.
Note: If you use the interface to modify the toolbars, you should cut and paste the modified portions of
the MNS file to the MNU file before deleting the MNS file.
The MENU command initially requests the MNS or MNC file. To reload a modified MNU file, choose the
Menu Template item from the file type list, and then choose the MNU file from the list of files. Doing so
protects the MNS file from accidentally being rebuilt, thus losing any toolbar or partial menu
modifications done through the interface. While building and testing a menu file, you may find this
procedure awkward. The following AutoLISP routine defines a new command, MNU, which reloads the
current MNU file without going through all the prompts.
(defun C:MNU ()
(command "_menu" (strcat (getvar "menuname") ".mnu"))
(princ)
)
If you add this code to your acad.lsp file, the MNU command is automatically defined when you restart
AutoCAD.
This function ensures that AutoCAD loads the AutoLISP functions that are needed for proper operation
Note: If a menu file is loaded with the AutoLISP command function (with syntax similar to (command
"menu" "newmenu") ), the associated MNL file is not loaded until the entire AutoLISP routine has run.
For example, if you create a custom menu called newmenu.mnu and you need to load three AutoLISP
files (new1.lsp, new2.lsp, and new3.lsp) for the menu to work properly, you should create an ASCII text
file named newmenu.mnl as follows:
(load "new1")
(load "new2")
(load "new3")
(princ "\nNewmenu utilities... Loaded.")
(princ)
In this example, calls to the princ function can be used to display status messages. The first use of princ
displays the following on the command line:
Newmenu utilities... Loaded.
The second call to princ exits the AutoLISP function. Without this second call to princ, the message
would be displayed twice. As mentioned previously, you can include the onfailure argument with calls to
the load function as an extra precaution.
If the user-defined function S::STARTUP is included in an acad.lsp, acaddoc.lsp or a .mnl file, it is called
when you enter a new drawing or open an existing drawing. Thus, you can include a definition of
S::STARTUP in the LISP startup file to perform any setup operations.
For example, if you want to override the standard HATCH command by adding a message and then
switching to the BHATCH command, use an acaddoc.lsp file that contains the following:
(defun C:HATCH ( )
(alert "Using the BHATCH command!")
(princ "\nEnter OLDHATCH to get to real HATCH command.\n")
(command "BHATCH")
(princ)
)
(defun C:OLDHATCH ( )
(command ".HATCH")
(princ)
)
(defun-q S::STARTUP ( )
(command "undefine" "hatch")
(princ "\nRedefined HATCH to BHATCH!\n")
)
Before the drawing is initialized, new definitions for HATCH and OLDHATCH are defined with the defun
function. After the drawing is initialized, the S::STARTUP function is called and the standard definition of
HATCH is undefined.
Note: To be appended, the S::STARTUP function must have been defined with the defun-q function
rather than defun.
Because an S::STARTUP function can be defined in many places (an acad.lsp, acaddoc.lsp, .mnl file, or
any other AutoLISP file loaded from any of these), it's possible to overwrite a previously defined
S::STARTUP function. The following example shows one method of ensuring that your start-up function
works with other functions.
(defun-q MYSTARTUP ( )
... your start-up function ...
The previous code appends your start-up function to that of an existing S::STARTUP function, and then
redefines the S::STARTUP function to include your start-up code. This works properly regardless of the
prior existence of an S::STARTUP function.
If a call to the load function is successful, it returns the value of the last expression in the file (usually
the name of the last defined function or a message regarding the use of the function). If the call fails, it
returns the value of the onfailure argument. In the preceding example, the value returned by the load
function is passed to the princ function, causing that value to be displayed on the command line. For
example, if an error occurs while AutoCAD loads the mydocapp1.lsp file, the princ function displays the
following message and AutoCAD continues to load the two remaining files:
MYDOCAPP1.LSP file not loaded.
If you use the command function in an acad.lsp, acaddoc.lsp or MNL file, it should be called only from
within a defun statement. Use the S::STARTUP function to define commands that need to be issued
immediately when you begin a drawing session. The S::STARTUP function is described in S::STARTUP
Function—Post-Initialization Execution.
Command Autoloader
When you automatically load a command using the load or command functions, the command's
definition takes up memory whether or not you actually use the command. The AutoLISP autoload
function makes a command available without loading the entire routine into memory. Adding the
following code to your acaddoc.lsp file automatically loads the commands CMD1, CMD2, and CMD3 from
the cmds.lsp file and the NEWCMD command from the newcmd.lsp file.
(autoload "CMDS" '("CMD1" "CMD2" "CMD3"))
(autoload "NEWCMD" '("NEWCMD"))
The first time you enter an automatically loaded command at the Command prompt, AutoLISP loads the
entire command definition from the associated file. AutoLISP also provides the autoarxload function for
ObjectARX applications. See "autoload" and "autoarxload" in the AutoLISP Reference.
You can automatically run a macro in the acad.dvb file by naming the macro AcadStartup. Any macro in
your acad.dvb file called AcadStartup automatically executes when VBA loads.
If you want a macro in your acad.dvb file to run each time you start a new drawing or open an existing
one, add the following code to your acaddoc.lsp file:
(defun S::STARTUP()
(command "_-vbarun" "updatetitleblock")
● When VBA is loaded it will look in the AutoCAD directory for a project named acad.dvb. This file
will automatically load as the default project
● Any project other than the default, acad.dvb, can be used by explicitly loading that project at
startup using the VBALOAD command. The following code sample uses the AutoLISP startup file
to load VBA and a VBA project named myproj.dvb when AutoCAD is started. Start notepad.exe
and create (or append to) acad.lsp the following lines:
(defun S::STARTUP()
You can cause a macro to run automatically when VBA loads by naming the macro AcadStartup. Any
macro in your acad.dvb file called AcadStartup will automatically get executed when VBA loads.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
In VBA you can only create Pulldown and Toolbar menu's, although you can access Image, Screen
and Tablet menu's.
This tutorial will demonstrate how to create Pulldown and Toolbar menu's, as well as show you a
few examples on how to use menu macro's to call AutoCAD command functions, AutoLisp routines
and Image menu's.
Let's begin with Pulldown menu's. First you need to create an empty file in Notepad called
"VbaMenu.mns". Make sure that this file is within your AutoCAD search path. Fire up AutoCAD,
open the VBA Editor and add this coding to a module :
'CODING STARTS HERE
Option Explicit
Sub VbaMenu1()
'==========================================================
'Create Pulldown Menu
'==========================================================
'Creat the pulldown menu title
Set newMenu = currMenuGroup.Menus.Add("V&BA Menu")
'==========================================================
Err_Control:
Select Case Err.Number
'The menu exists, just exit
Case -2147024809
Err.Clear
Resume Just_Here
Case Else
MsgBox Err.Description
Exit Sub
End Select
End Sub
Try out each menu item. It works hey! Now navigate your way to were you stored VbaMenu.mns
and open it. You should see something like this :
//
// AutoCAD menu file - O:\e51d\e51d1\VbaMenu.mns
//
***MENUGROUP=VbaMenu
***POP2
ID_mnuVBA Menu [V&BA Menu]
ID_VBA Load [VBA &Load]^C^C_vbaload
ID_VBA Editor [VBA &Editor]^C^C_vbaide
ID_VBA Macro [VBA &Macro]^C^C_vbarun
ID_VBA Manager [&VBA Manager]^C^C_vbaman
[--]
ID_Zoom [&Zoom]^C^C_zoom w
ID_View Point [View &Point]^C^C_(if (not c:ddvpoint) (load "ddvpoint") ddvpoint
ID_3D Objects [&3D Objects]^C^C_$I=image_3dobjects $I=*
ID_AfraLisp.com [&AfraLisp.com]^C^C_browser www.afralisp.com
***TOOLBARS
***HELPSTRINGS
ID_VIEW POINT [View Point]
ID_AFRALISP.COM [Visit AfraLisp now, or else.]
ID_VBA MANAGER [Display the VBA Manager]
//
// End of AutoCAD menu file - O:\e51d\e51d1\VbaMenu.mns
//
You should also find VbaMenu.mnc and VbaMenu.mnr in the same folder. Even though the
VbaMenu.mns file was empty when we started, VBA has created all the coding necessary and
compiled the other menu support files required for the menu to run.
On the next page, we'll have a look at creating Toolbar menu's.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Sub VbaMenu2()
'==========================================================
' Create Toolbar Menu
Set newToolBar = currMenuGroup.Toolbars.Add("Vba Menu")
'==========================================================
'vbaload macro and bitmaps
openMacro = Chr(3) & Chr(3) & Chr(95) & "vbaload" & Chr(32)
Set newToolBarButton = newToolBar.AddToolbarButton(newToolBar.Count + 1, "VBA Load",
"VBALoad", openMacro, False)
SmallBitmapName = "VBALOAD.BMP"
LargeBitmapName = "VBALOAD.BMP"
newToolBarButton.SetBitmaps SmallBitmapName, LargeBitmapName
newToolBarButton.HelpString = "Load a VBA Application"
'==========================================================
'vbaide macro and bitmaps
openMacro = Chr(3) & Chr(3) & Chr(95) & "vbaide" & Chr(32)
Set newToolBarButton = newToolBar.AddToolbarButton(newToolBar.Count + 1, "VBA Editor",
"VBA Editer", openMacro, False)
SmallBitmapName = "VBAIDE.BMP"
Just_Here:
Exit Sub
Err_Control:
Select Case Err.Number
'The menu exists, just exit
Case -2147024809
Err.Clear
Resume Just_Here
Case Else
MsgBox Err.Description
Exit Sub
End Select
End Sub
'CODING ENDS HERE
Run the VbaMenu2 macro. A toolbar like this should appear on your screen :
***MENUGROUP=VbaMenu
***TOOLBARS
***HELPSTRINGS
ID_VBA_MANAGER_0 [VBA Manager]
ID_VBA_LOAD_0 [Load a VBA Application]
ID_RUN_MACRO_0 [Run Macro]
ID_VBA_EDITOR_0 [VBA Editer]
//
// End of AutoCAD menu file - VbaMenu.mns
//
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Sub VbaMenu3()
'===================================================================
'find the shortcut menu
For Each entry In currMenuGroup.Menus
If entry.ShortcutMenu = True Then
Set scMenu = entry
End If
Next entry
'===============================================
'===============================================
Just_Here:
Exit Sub
Err_Control:
Select Case Err.Number
'The menu exists, just exit
Case -2147024809
Err.Clear
Resume Just_Here
Case Else
MsgBox Err.Description
Exit Sub
End Select
End Sub
Now open the AutoCAD.mns file and have a look at the POP0 menu section.
***POP0
**SNAP
[&Object Snap Cursor Menu]
Right, let's now add to the cursor menu. Place this coding into a module and save it as VbaMenu4.
'CODING STARTS HERE
Private Sub AcadDocument_BeginShortcutMenuDefault(ShortcutMenu As
AutoCAD.IAcadPopupMenu)
On Error Resume Next
'Add a menu item to the cursor menu
Dim newMenuItem As AcadPopupMenuItem
Dim openMacro As String
openMacro = Chr(27) + Chr(27) + Chr(95) + "trim" + Chr(32) + Chr(32)
Set newMenuItem = ShortcutMenu.AddMenuItem _
(11, "&Trim", openMacro)
openMacro = Chr(27) + Chr(27) + Chr(95) + "extend" + Chr(32) + Chr(32)
Set newMenuItem = ShortcutMenu.AddMenuItem _
(12, "&Extend", openMacro)
End Sub
You should have two new menu items, namely Trim and Extend.
Do you notice that this does not force the AutoCAD menu to re-compile but just adds and deletes
from it on the fly. Worth thinking about isn't it?
Would you like to boldly go where no man ever goes? Then be brave and just click here for the
source coding.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
To download this complete Tutorial including, all Menu's and Support files,
be brave and Click Here.
(load "DDStruc_Steel_Ver2")
To have to type this in, or even remember the name every time you need to load or, run the routine,
is just basically daft and un-productive.
You could, load all your routines from the Acad.Lsp file. This though, would mean that they are all
in memory, chewing up your system resources.
What you need to be able to do is to load/run the routines from the AutoCAD menu. Not so long
ago, in earlier releases, the only option you had was to modify the standard AutoCAD menu. Not
anymore. Now you can create a custom menu known as a "Partial Menu" and install this to run
side by side with the standard AutoCAD menu.
This Tutorial will take you through all the steps of developing a fully, functional Custom Standard
Menu.
Note : I will only be covering Pull Down Menu's, Image Menu's and Toolbars in this tutorial. If you
need information on Screen, Button or Tablet Menu's, then please refer to the AutoCAD
Customization Manual.
To get started let's begin with designing a simple Pull Down or Pop Menu.
Fire up your text editor and type in the following saving the file as Test.Mnu :
(Please ensure that you save all files to a directory in the AutoCAD Search Path.)
***MENUGROUP=TEST //menu name
This is the "Name Tag" or "ID" of the menu item and allows you to access the menu item
programmatically. The second part :
[Test-Menu]
A new menu item will appear on the menu bar entitled "Test Menu".
It should look like this :
O.K. Now we've got our menu to display but, there's a problem. It doesn't do anything!! Let's make
it functional.
Create a new menu file entitled TEST1.MNU and type in the following:
***MENUGROUP=TEST1
***POP1
P1-1[&Test Menu1]
P1-2[&Line]^C^CLine
P1-3[&Copy]^C^CCopy
P1-4[M&ove]^C^CMove
P1-5[&Zoom]^C^CZoom
Load this menu, following the same routine as you did for the first menu.
"Test Menu1" will appear in the menu bar and your new pull down menu should look like this :
The first part, P1-1 is, of course, the menu item ID.
The second part, [&Line] is the menu label. But did you notice something different? What is the '&'
character doing in front of the 'L'?
If you precede any letter in the menu item label with '&', this will define the letter as the shortcut
Just in case we have a previous incomplete command, we use the string ^C^C to start our menu
macro. This is exactly the same as pressing CTRL+C or ESC, twice on the keyboard. We use ^C
twice because some AutoCAD commands need to be cancelled twice before they return to the
Command prompt.
(e.g. The Dim Command.)
We immediately follow this sequence with our AutoCAD command, Line.
When a menu item is selected, AutoCAD places a blank after it. A blank in a menu macro is
interpreted as ENTER or SPACEBAR. In effect, this is exactly the same as typing, at the command
prompt "Line" followed by ENTER.
More about Menu Macro's on the next page......
Home. Page II. Page III. Page IV.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
***POP1
P1-1[&Test Menu2]
P1-2[&Layer 2 On]^C^CLayer;M;2;;
P1-3[&Ortho On/Off]^C^C^O
P1-4[Change to Layer 3]*^C^CChange;\;P;LA;3;;
P1-5[&Hello World](alert "Hello World")
Your Menu should look like this :
Crazy, Hey. As I said, rather write an AutoLISP routine. You can do a hell of a lot more and, create a
much more professional routine using AutoLISP than you ever will trying to write super-duper, 20 line
macro's.
Just one small point about the above macro. Did you notice the use of the special character + at the end of
some of the lines. This allows the macro to continue to the next line.
Anyway, enough about menu macro's. Let's have a look at some special label characters that you can use
in pull-down menu's.
-- Item label that expands to become a separator line.
+ Continues macro to next line.
-> Label prefix that indicates that the pull-down menu item
has a submenu
<- Label prefix that indicates that the pull-down menu item
is the last item in a submenu.
<-<-.. Label prefix that indicates that the pull-down menu item
is the last item in the submenu, and terminates the parent
menu. One <- is required to each terminate each parent menu.
~ Lable prefix that disables a menu item.
!. Label prefix that marks a menu item.
& Label prefix that defines shortcut key.
On the next page we will have a look at an example menu using
some of these special characters.
Page I. Home. Page III. Page IV.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
OK, I see you're back. Now load the following menu file :
***MENUGROUP=TEST3
***POP1
P1-1[&Test Menu 3]
P1-2[&Layer 2 On]^C^CLayer;M;2;; //menu item
P1-3[--] //divider
P1-4[&Ortho On/Off]^C^C^O //menu item
P1-5[--] //divider
P1-6[->&Change] //submenu label
P1-7[->C&hange Layer] //submenu label
P1-8[Change to Layer 1]^C^CChange;\;P;LA;1;; //submenu items
P1-9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1-10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1-11[<-Change to Layer 4]^C^CChange;\;P;LA;4;; //submenu terminator
P1-12[->Ch&ange Colour] //submenu label
P1-13[Change to Colour 3]^C^CChange;\;P;C;1;; //submenu items
P1-14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1-15[Change to Colour 3]^C^CChange;\;P;C;3;;
P1-16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;; //submenu terminator
P1-17[--] //divider
P1-18[&Kenny](alert "Kenny is Handsome") //menu item
Your menu, hopefully, should look like this :
Right, enough of pull-downs for the meantime. Let's now have a look at Image Menu's.
Firstly, we need to create a couple of slides to display in our image menu.
Let's create some slides named D1 to D8, DDOOR and HDDOOR.
You can create these slides yourself using any object that you wish, as long as they are named as stated. (I
need the server space and drawing files are rather big.) Now we need to create a file library as a container
for these slides.
Locate the Slidelib.exe function. It is normally in your Acad Support directory. Copy it to the same
directory as your slides.
Now create a text file named Slidelist.LST and in it, make a list of all the slide names. (Remember to check
spelling and case.)
D1
D2
D3
D4
D5
D6
D7
D8
DDOOR
HDDOOR
Make sure that this file is also in the same directory as the slides.
Now go to DOS. (Remember that 'black' place?)
At the DOS prompt find your way to the directory where your slides, Slidelib.exe and Slidelist.LST are
located.
Type :
slidelib DOORS < Slidelist.LST then ENTER.
If you have done everything correct, DOORS.SLB should be created.
Next, we need to add an Image section to our menu file :
***MENUGROUP=TEST4
***POP1
P1_1[&Test Menu 4]
P1_2[&Layer 2 On]^C^CLayer;M;2;;
P1_3[--]
P1_4[&Ortho On/Off]^C^C^O
P1_5[--]
P1_6[->&Change]
P1_7[->C&hange Layer]
P1_8[Change to Layer 1]^C^CChange;\;P;LA;1;;
P1_9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1_10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1_11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;
P1_12[->Ch&ange Colour]
P1_13[Change to Colour 3]^C^CChange;\;P;C;1;;
P1_14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1_15[Change to Colour 3]^C^CChange;\;P;C;3;;
P1_16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;
P1_17[--]
P1_18[&Kenny](alert "Kenny is Handsome")
P1_19[--]
P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=* //calls Image Menu
***IMAGE
**DOORS
[DOORS Created by Kenny Ramage ]
[DOORS(D1,DOOR1)]INSERT;*D1;\;;
[DOORS(D2,DOOR2)]INSERT;*D2;\;;
[DOORS(D3,DOOR3)]INSERT;*D3;\;;
[DOORS(D4,DOOR4)]INSERT;*D4;\;;
[DOORS(D5,DOOR5)]INSERT;*D5;\;;
[DOORS(D6,DOOR6)]INSERT;*D6;\;;
[DOORS(D7,DOOR7)]INSERT;*D7;\;;
[DOORS(D8,DOOR8)]INSERT;*D8;\;;
[DOORS(DDOOR,DOUBLE DOOR)]INSERT;*DDOOR;\;;
[DOORS(HDDOOR,DOOR & HALF)]INSERT;*HDDOOR;\;;
[ FITTINGS]$I=KENNY.FITTINGS $I=*
And your Image menu like this (with different images of course) :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The easiest way of creating a custom toolbar is to use the AutoCAD interface.
First, copy and rename Test4.MNU to Test5.MNU. Edit the menu file so that it looks like this :
***MENUGROUP=TEST5
***POP1
P1_1[&Test Menu 5]
P1_2[&Layer 2 On]^C^CLayer;M;2;;
P1_3[--]
P1_4[&Ortho On/Off]^C^C^O
P1_5[--]
P1_6[->&Change]
P1_7[->C&hange Layer]
P1_8[Change to Layer 1]^C^CChange;\;P;LA;1;;
P1_9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1_10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1_11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;
P1_12[->Ch&ange Colour]
P1_13[Change to Colour 3]^C^CChange;\;P;C;1;;
P1_14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1_15[Change to Colour 3]^C^CChange;\;P;C;3;;
P1_16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;
P1_17[--]
P1_18[&Kenny](alert "Kenny is Handsome")
P1_19[--]
P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=*
***IMAGE
**DOORS
[DOORS Created by Kenny Ramage ]
[DOORS(D1,DOOR1)]INSERT;*D1;\;;
[DOORS(D2,DOOR2)]INSERT;*D2;\;;
[DOORS(D3,DOOR3)]INSERT;*D3;\;;
[DOORS(D4,DOOR4)]INSERT;*D4;\;;
[DOORS(D5,DOOR5)]INSERT;*D5;\;;
[DOORS(D6,DOOR6)]INSERT;*D6;\;;
[DOORS(D7,DOOR7)]INSERT;*D7;\;;
[DOORS(D8,DOOR8)]INSERT;*D8;\;;
[DOORS(DDOOR,DOUBLE DOOR)]INSERT;*DDOOR;\;;
[DOORS(HDDOOR,DOOR & HALF)]INSERT;*HDDOOR;\;;
[ FITTINGS]$I=KENNY.FITTINGS $I=*
Open AutoCAD and load this new menu file.
Now, to create a new toolbar, follow these steps :
Select "New".
The New Toolbar dialogue will open
In the "Toolbar Name" edit box enter "Testbar" and from the "Menu Group" drop down list
select Test5.mnu
Select O.K.
A small empty toolbar will appear on your screen.
Select "Customize" from the "Toolbars" dialogue.
The "Customize Toolbars" dialogue will open.
Select "Close"
You now have a toolbar with 3 buttons that do exactly nothing!!
Right Click on the first blank tile.
The "Button Properties" dialogue will open.
Select any of the buttons on the toolbar and you should get an alert message.
Now Exit AutoCAD.
Open Test5.mnu
Do you notice that nothing has changed and there is no Toolbar section in the MNU file?
The reason for this is because when you Add, Move or Edit any toolbars using the AutoCAD
interface, the results are written to the MNS file and not to the MNU file. To update the MNU file
and make our changes permanent, we need to copy and paste the toolbars section from the MNS
file into the MNU file.
Right, let's do that. Your MNU file should now look like this :
***MENUGROUP=TEST5
***POP1
***IMAGE
**DOORS
[DOORS Created by Kenny Ramage ]
[DOORS(D1,DOOR1)]INSERT;*D1;\;;
[DOORS(D2,DOOR2)]INSERT;*D2;\;;
[DOORS(D3,DOOR3)]INSERT;*D3;\;;
[DOORS(D4,DOOR4)]INSERT;*D4;\;;
[DOORS(D5,DOOR5)]INSERT;*D5;\;;
[DOORS(D6,DOOR6)]INSERT;*D6;\;;
[DOORS(D7,DOOR7)]INSERT;*D7;\;;
[DOORS(D8,DOOR8)]INSERT;*D8;\;;
[DOORS(DDOOR,DOUBLE DOOR)]INSERT;*DDOOR;\;;
[DOORS(HDDOOR,DOOR & HALF)]INSERT;*HDDOOR;\;;
[ FITTINGS]$I=KENNY.FITTINGS $I=*
***TOOLBARS
**TESTBAR
ID_1 [_Toolbar("Testbar", _Floating, _Show, 202, 163, 1)]
ID_2 [_Button("Test Tool 1", "ICON.bmp", "ICON_24_BLANK")]
^C^C(Alert "Test Tool 1")
ID_3 [_Button("Test Tool 2", "ICON0041.bmp", "ICON_24_BLANK")]
^C^C(Alert "Test Tool 2")
ID_4 [_Button("Test Tool 3", "ICON8467.bmp", "ICON_24_BLANK")]
^C^C(Alert "Test Tool 3")
To download this complete Tutorial including, all Menu's and Support files,
be brave and Click Here.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Now save this file as Layer.txt, ensuring that it is within your support path.
Now open a new Project and Userform. Place a Listbox on the form keeping the default name.
In the Userform Initialize event procedure, place the following code :
'CODING STARTS HERE
'clear listbox
ListBox1.Clear
'loop
Wend
End Sub
In the preceding example, 1 is the file number. However, if you open and close multiple files
throughout your program, using this number might not be a good idea. In that case, you should use
the "FreeFile" function. I've re-written the coding below to include this function as well as some
basic error trapping :
'CODING STARTS HERE
Private Sub UserForm_Initialize()
'clear listbox
ListBox1.Clear
'loop
Wend
Exit Sub
err_handler:
End Sub
To write data, you open the file for sequential output or append. Have a look at the following two
lines of code, each of which opens a file for output :
'output mode - always creates a new file, erases any existing information
Open "DwgLog.txt" for Output as #nFile
Append mode means data written to a file is added to the end of existing data. Opening a file for
Output means that any existing data will be erased. In either case the Open statement automatically
creates the file if it does not exist.
Have a look at the following coding that when you run it, will write a Log file containing the date,
time and Drawing Number :
'CODING ENDS HERE
Sub DrgLog ()
Exit Sub
err_handler:
End Sub
DrgLog.txt should have been created in your working directory. Open it and have a look. It should
look something like this :
11-02-01 09:57:20 - X3481.dwg
11-02-01 19:57:21 - X3482.dwg
11-02-01 14:40:20 - K2341.dwg
11-02-01 15:21:40 - K3418.dwg
Every time the routine is run, the date, time and Drawing Number is added to the file. (Hey, we
could make a good drawing log file out of this?)
On the next page we'll have a look at opening and searching a text file for multiple instances of
information required for a program to run.
Home. Page II.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Home. Page I.
Option Explicit
'=============================================
'=============================================
'clear listbox
ListBox1.Clear
'end if
End If
'loop
Wend
Exit Sub
err_handler:
MsgBox "Error No " & Err.Number & " - " & Err.Description
Err.Clear
Exit Sub
End Sub
'-------------------------------------------------------------------------------------------------
'read the next line and retrieve the values from the text file
'storing them into their respective variables
Input #nFile, sHeight, sWidth, sThickness, sRadius1, sRadius2
'loop
Wend
Exit Sub
err_handler:
MsgBox "Error No " & Err.Number & " - " & Err.Description
Err.Clear
Exit Sub
End Sub
'-------------------------------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------------------------------
End Sub
Highlight a size and select "OK" or double-click on the size. A message box should appear listing
the un-equal angles vital statistics :
Now all you need to do is draw the un-equal angle. Hey, don't look at me, I've done enough for
today and I'm now off for a beer. Cheers!!!
Whoops, almost forgot! You probably want the source coding. Okey dokey, just click here.
Home. Page I.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
For this you will need a UserForm containing 1 Label for the Listbox, 1 ListBox, 3 Buttons, two Frames
for the TextBoxes, 6 TextBoxes (3 in each Frame,) and 6 Labels for the TextBoxes. Retain all of their
default names and captions.
Option Explicit
'-----------------------------
'declare the public variables
Public theline As Object
Public AllLayers As AcadLayers
'------------------------------
End Sub
'----------------------------------
'******************************
'This is the part you've been
'waiting for.
'Hide the dialog
Me.Hide
'difficult hey??
'******************************
Missed:
Else
End If
GoThere:
'******************************
'And to unhide the dialog......
'redisplay the dialog
Me.Show
'Also very difficult!!!
'******************************
Exit Sub
End Select
End Sub
'---------------------------------
End Sub
'-----------------------------------
End Sub
'------------------------------
End Sub
'----------------------------
thestarty = theline.StartPoint
thestarty(1) = TextBox2.Text
theline.StartPoint = thestarty
theline.Update
End Sub
'-----------------------------
thestartz = theline.StartPoint
thestartz(2) = TextBox3.Text
theline.StartPoint = thestartz
theline.Update
End Sub
'-----------------------------
theendx = theline.EndPoint
theendx(0) = TextBox4.Text
theline.EndPoint = theendx
theline.Update
End Sub
'-----------------------------
theendy = theline.EndPoint
theendy(1) = TextBox5.Text
theline.EndPoint = theendy
theline.Update
End Sub
'-----------------------------
theendz = theline.EndPoint
theendz(2) = TextBox6.Text
theline.EndPoint = theendz
theline.Update
End Sub
'------------------------------
Of course, you will also need something to run your program with. Insert a new module and add this :
Load and run the program. A dialog will appear with a ListBox containing all the Layers within your
drawing. You will find that none of the controls work with the exception of the Buttons. Press the
"Select Line >>" button and the dialog will be hidden. Now, choose any line within your drawing. If you
miss the line, or select an object that is not a line, a message box will appear informing you that you've
messed up. Don't worry, the program will let you try again. Once you've mastered the art of selecting a
line, the dialog will re-appear. The ListBox will now show you what layer your line is on, along with the
x, y and z co-ordinates of the lines Start and End points.
Choose a different Layer in the ListBox. Notice how the line is immediately change to the new Layer?
Now change one of the x or y co-ordinates. Again, the line is immediately updated and "moved" to the
new set of co-ordinates. (Oh, by the way, no validation is performed on the values entered into the x, y
and z co-ordinate TextBoxes. If you enter anything other than a number, I've a sneaky suspicion that the
program may crash.)
Here's the source coding for all you lazy ones out there - Vba-Hide.zip (26 kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Probably the most vexing (on my part) query I get, is in regards to hiding dialog boxes.
It seems to take ages and numerous emails before the poor soul trying to grasp the concept finally
understands the principle, or (and this is more likely) gives up and joins a monastery/nunnery.
So, without further due, and absolutely no regard for my own safety, I'm going to have another shot at
explaining how to go about hiding such a wee delicate thing as a dialog box.
Okay, are you ready? Are you sat nice and comfy on your cuddly, wuddly little bottom?
The let's do it!!!
("Randall, could you please keep the noise down 'cos I'm trying to explain something here. What?
You're eating!! Try and use a knife and and fork - I know it's chicken and you're allowed to use your
fingers, but you're supposed to cook the thing and remove the feathers first.")
Often you need to make a selection on the screen whilst a dialog box is active. But to do this, you need
to be able to hide the dialog box to allow the user to make a selection from the screen. You must then
restore the dialog box, along with the values that the user has selected. To accomplish this lets first
have a look at two of the most critical DCL functions :
(done_dialog [status])
● status : A positive integer that (start_dialog) will return instead of returning 1 for OK or 0 for
Cancel. The meaning of any status value greater than 1 is determined by your application.
● Usage Notes : An explicit AutoLisp action for the "accept" button must specify a status of 1 (or an
application-defined value); otherwise, (start_dialog) returns the default value, 0, which makes it
appear as if the dialog box was canceled.
(start_dialog)
● Return Values : The (start_dialog) function returns the optional status passed to (done_dialog).
The default value is 1 if the user presses OK, 0 if the user presses Cancel, or -1 if all dialog boxes
are terminated with (term_dialog). If (done_dialog) is passed an integer status greater than 1,
(start_dialog) returns this value, whose meaning is determined by the application.
By testing this value in a (while) loop we can determine whether the dialog was simply hidden or
accepted or cancelled. Below is a sample routine that should, hopefully, I hope and pray, explain it to
you a lot better.
This routine simply displays a dialog box with three buttons
If you select "OK" or "Cancel", an alert box is displayed and the dialog is simply closed.
But, if you click the "Select Object" button, the dialog is hidden and an alert box is displayed informing
you of the fact. After selecting OK, the dialog is re-displayed or, to use the words of a great magician
that I once knew, un-hidden.
hidedialog1 : dialog {
label = "Hide Dialogue";
: button {
label = "Hide Dialog >>";
key = "hide";
width = 8;
fixed_width = true;
mnemonic = "H";
alignment = centered;
is_default = true;
}
ok_cancel;
;set flag to 4
(setq flag 4)
);while
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ);load clean
Let's now get really brave and have a look at a wee practical example.......................
Home Page II
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
hidedialog : dialog {
label = "Hide Dialogue";
: list_box {
label = "&Properties :";
key = "selections";
height = 7;
width = 25;
}
: button {
label = "Select Object >>";
key = "hide";
width = 8;
fixed_width = true;
mnemonic = "S";
alignment = centered;
is_default = true;
}
ok_cancel;
(vl-load-com)
;set flag to 4
(setq flag 4)
;convert to vl object
(setq ent (vlax-Ename->Vla-Object (car ent)))
);setq
);progn
);if
);while
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ);load clean
Hey just think! You can now design your own properties dialog.
Well that's about it regarding hiding dialog boxes.
I hope you had a good time, enjoyed the snacks (especially the chicken) and didn't drink too much beer.
Remember, don't drink and drive because you might spill some.
Did I forget? No I didn't. If you would like to download the source coding, just click here.
Home Page I
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The Chord length can be calculated as the straightline distance between two points. We have a function defined called
"Calculate3Ddistance" that does just that :
Passing in the 2 points, we get back the full chord length. Divide by 2 and we have the short leg of the triangle above (y).
We can calculate the Hypotenuse which is also the radius using f, and the short leg using the following formula :
However,
Unfortunately, the Cosecant function is not defined in VB, so we are left with the 1/sin version.
Tying all of this together, we have a function called "CalculatePolylineLength" We pass the function an entity. We test to
ensure it is a Polyline, then proceed to the actual work.
First, we get the upper and lower bounds of the coords variant. Then begin a For Next loop to loop through each set of 2D
coordinates. Because the "GetBulge" method of the polyline object returns the bulge for a segment, and there are ½ the
number of segments as thare are coordinates (2 coordinates per point), we get the bulge of the loop counter/2 instead of
the loopcounter.
We then get the coordinates of the first point, x1 & y1, then the coordinates of the second point x2 & y2. Depending on
the value of the bulge, we either call the "Calculate3D Distance" or "CalculateArcLength" keeping a running total of the
lengths.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Polyline Bulges
By Stig Madsen, 2003
Bulges are something that women have (mostly to please the opposite sex it seems) and something that guys try to get by
placing socks in strategic places. At least until they get older. Which is the time they tend to develop bulges in not so strategic
places. In other words: bulges are all about curvature.
In AutoCAD, bulges are used in shapes and in arc segments of polylines. This article only deals with polyline bulges, and
because polyline bulges are describing circular arcs, let's first look at the geometry of a circular arc.
Because a circular arc describes a portion of the circumference of a circle, it has all the attributes of a circle:
● Radius (r) is the same as in the circle the arc is a portion of.
● Center point (P) is also the same as in the circle.
● Included angle (θ). In a circle, this angle is 360 degrees.
● Arc length (le). The arc length is equal to the perimeter in a full circle.
Adding to these attributes are some that are specific for an arc:
● Start point and end point (P1 and P2) a.k.a. vertices (although sometimes it is practical to talk about specific points that a
circle passes through, there are no distinct vertices on the circumference of a circle).
● Chord length (c). An infinite amount of chords can be described by both circles and arcs, but for an arc there is only one
distinct chord that passes through its vertices (for a circle, there is only one distinct chord that passes through the
center, the diameter, but it doesn't describe any specific vertices).
● Given two fixed vertices, there is also a specific midpoint (P3) of an arc.
Except for the arc itself, an arc can describe two distinct geometric forms: Circular segment and circular sector. Both figures
includes all of the attributes above, but for doing calculations with bulges, we'll mostly use the piece of pie that the arc cuts out
of a circle, the circular sector.
So, what is a bulge for a circular arc and how is it defined? In AutoCAD's online help reference, it says about bulges for
polylines:
The bulge is the tangent of 1/4 of the included angle for the arc between the selected vertex and the next vertex in the polyline's
vertex list. A negative bulge value indicates that the arc goes clockwise from the selected vertex to the next vertex. A bulge of 0
indicates a straight segment, and a bulge of 1 is a semicircle.
What does this mean and how can an arc be defined without even knowing the radius - or at least a chord length? It says that
the only information given for arc segments in polylines are two vertices and a bulge.
Well, it also says that the bulge has something to do with the tangent of a quarter of the included angle of an arc. That must be
a clue of how to obtain the angle. In fact, once you have a bulge value, you can very quickly retrieve the included angle by
inverting the above statement. Simply use the built-in function ATAN to get an angle and multiply it by 4 in order to get the
included angle:
(* 4.0 (atan 0.57735))
2.09439
So, a bulge of 0.57735 is describing an included angle of 2.09439 radians (which is 120.0 degrees, by the way). Try it out for yourself. Start
drawing a lightweight polyline, type "A" for arc, then "A" again for Angle and "120.0" for the included angle. Drop the endpoint somewhere,
leave the polyline command and type this at the command line:
Command: (setq ent (entget (entlast)))
((-1 . < Entity name: 7ef844f8>) (0 . "LWPOLYLINE") (330 . < Entity name:
7ef5ccf8>) (5 . "31F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
(100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10
-566.044 916.408) (40 . 0.0) (41 . 0.0) (42 . 0.57735) (10 -485.424 1075.7) (40
. 0.0) (41 . 0.0) (42 . -7.40144) (210 0.0 0.0 1.0))
Command: (setq bulge (cdr (assoc 42 ent)))
0.57735
Now you have a bulge value for the arc segment in the polyline, and you can try out the formula above.
Ok, fine. But why is the bulge 1/4 of the included angle and where does the tangent fit in? There are many ways to explain this. One is shown
below. The figures show a circle with a central angle describing an arc and we'll try to show that the yellow angles ε and σ are
exactly one quarter of the cyan central angle θ.
If the full angle is cut in half - as shown with the blue angle η at figure 2 - we get an isosceles triangle (green) where the angles φ and
τ are equal. Because the sum of angles in a triangle is always 180 degrees, we now know that the angles φ and τ are
Æ = Ä = (180 - ¸/2)/2 => Æ = 90 - ¸/4
Now look at the chord from P1 to P2 in figure 3. Together with the red legs of angle θ it also forms an isosceles triangle, and therefore
γ is equal to ξ. The top angle is the full angle of θ, so γ and ξ become equal to
³ = ¾ = (180 - ¸)/2 => ³ = 90 - ¸/2
Thus, the yellow angle ε must be the magenta angle φ minus the orange angle γ. In other words, ε is a quarter of
the included angle θ:
µ = (90 - ¸/4) - (90 - ¸/2) => µ = ¸/2 - ¸/4 = ¸/4
The bulge is describing how much the arc "bulges out" from the vertices, i.e. the height of the arc (the sagitta (s), or the distance P3 to P4 in
figure 4). The height forms a leg of a right-angled triangle that has an exact angle of 1/4 of the included angle (see the yellow triangle P-P2-P3
in figure 4) and because tangent is describing the ratio between the legs in a right-angled triangle, it's easy to describe the geometry with this
one angle:
sin µ/cos µ = tan µ
We could also find tangent of angle ε by simply dividing the opposite leg with the adjacant leg - which means the sagitta, s, divided by
half the distance of the chord, c, - but not knowing s and having the tangent of ε already, we would rather want to find s:
s = c/2 * tan(µ)
Given that bulge = tan(ε), we get
s = c/2 * bulge
Radius of the arc can now be found with this formula:
r = ((c/2)2+s2)/2*s
The sign of a particular bulge is important for the way it's defined in relation to the vertices. If a bulge is positive it means that the arc is
measured counterclockwise from the starting vertex to the end vertex. If a bulge is negative it means that the arc runs the other way round, -
it's measured clockwise. The system variable ANGDIR has no influence on this.
Therefore all the formulas above has to be concerned about the absolute value of the bulge instead of the actual value - or you might end up
with a negative radius. In the code below we will find the center point. There are many ways to do this, but the method that is chosen here
relies on the angles that were defined previously. Subsequently, we will need it to test whether the bulge is postive or negative and act
accordingly.
Remember that the orange angle γ in fig. 3 was found to be 90 degrees minus half of the included angle? What happens if we add (or
subtract, depending on the arc direction) this angle to the angle between the two known vertices P1 and P2? We get the angle towards the
center. Knowing the angle, the radius and the start point of the arc we can find the center point with POLAR.
(setq gamma (/ (- pi theta) 2.0)
phi (if (>= bulge 0)
(+ (angle p1 p2) gamma)
(- (angle p1 p2) gamma)
)
p (polar p1 phi r)
)
Another way to find the direction towards the center is to use good old Pythagorus. We already know radius and the chord length, so by using
radius as the hypothenuse and half the chord length as a leg in a right-angled triangle, where the apothem is the second leg, it's possible to
draw the apothem and find the center point.
Page II
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
PolyLines.
The lwpolyline entity, or "optimized polyline," is new to Release 14.
A lwpolyline is defined in the drawing database as a single graphic entity.
This is different than a standard polyline, which is defined as a group of subentities. Lwpolylines
display faster and consume less disk space and RAM.
In Release 14, 3D polylines are always created as standard polyline entities.
2D polylines are created as lwpolyline entities unless they have been curved or fitted with the PEDIT
command. When a drawing from a previous release is opened in Release 14, all 2D polylines convert
to lwpolylines automatically unless they have been curved or fitted or contain xdata.
(setq r 1)
;set loop control number to 1
(while r
;while loop control is not nil, carry on looping
(progn
;do the following
(terpri)
;new line
);progn
(setq r nil)
;if end of sequence, stop looping
);if
);while
(princ)
);defun
(princ)
There is a quicker way of retrieving the entity list of a Polyline vertex.
Blocks.
Create a block consisting of a couple of lines and a circle with a radius of 20.
LwPolylines.
As we mentioned earlier, LwPolylines are a new feature in AutoCad Release 14.
They differ in that they are defined as a single entity. Let's have a look at a LwPolylines entity list.
Draw a LwPolyline and enter this:
(setq n 0)
;set counter to zero
(repeat len
;repeat for the length of the entity list
(if (= e1 10)
;check for code 10 (vertex)
(progn
;if it's group 10 do the following
(terpri)
;new line
);progn
);if
(setq n (1+ n))
;increment the counter
);repeat
(princ)
);defun
(princ)
Well, that's it concerning Polylines and Blocks. I told you it was easy!!!
Remember, I've only scratched the surface with the things that you can do once you dig into entity lists,
especially with complex entities.
One last thing. Want to create your own entity?
Normally, in AutoLisp you would draw a line like this:
(command "Line" pt1 pt2 "")
Now, create you own line by doing this:
(setq e '((0 . "LINE")(8 . "0")(10 50.0 50.0 0.0)(11 100.0 100.0 0.0)))
(entmake e)
Makes you think, doesn't it??
Cheers for now................
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Another method could be to view the arc as a part of the circumcircle to triangle P1-P2-P3. The medians
to the lines P1-P3 and P2-P3 intersect in the center point. We know the gradients for these medians
because both angles are known. E.g. any perpendicular to the line P1-P3 has the gradient (- (/ 1.0 gr)),
where gr is the gradient of P1-P3. Once having a point of the median (midpoint of P1-P3) and the grade,
it's possible to find the Y-interception and thereby the equation for the median. Doing this for both
medians we can use the following formulas for finding the intersection point - which is the center point
for the arc:
xi = - (m1 - m2)/(n1 - n2)
yi = m1 + n1*xi
where
m1 = gradient for median to P1-P3
n1 = Y-interception for median to P1-P3
m2 = gradient for median to P2-P3
n2 = Y-interception for median to P2-P3
There are many other solutions for finding the center point - among those some shorter trigonometric
methods - but this will have to do for now.
Because the geometry described by the 2 vertices and the bulge is relatively simple, there are many
other formulas than those depicted here. The important part is to understand how the bulge is defined
Page I
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Using the sin/cos, tan/sec, and cot/csc Triangles to Establish Basic Trigonometric
Identites
The three similar triangles sin/cos, tan/sec, and cot/csc are extracted from the figure. A fourth similar
triangle is shown with the adjacent, opposite, and hypotenuse sides labelled.
The definition of the six trigonometric functions and other useful identities follow from using the fact
that the ratio of corresponding sides of similar triangles must be the equal. The results are:
Using the sin/cos, tan/sec, and cot/csc Triangles to Determine the Pythagorean Idenities
The Pythagorean Theorem states: in any right-angled triangle, the sum of the squares of the lengths of
the sides containing the right angle is equal to the square of the hypothenuse. In short c2 = a2 + b2.
Applying the Pythagorean Theorem to the sin/cos, tan/sec, and cot/csc triangles gives:
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
ACCESSing AutoCAD
Written by Scott McGlynn - [email protected]
Scott has been working with AutoCAD since 1985 (Release 2.15) and with Visual Basic since 1993.
He has worked for one of the larger electrical contractors in the US since 1994 as a Project Engineer. He
recently acquired a BS in Business Administration.
In regards to VB, he has been mostly self taught with a couple of classes here and there over
the years.
Microsoft Access is a simple relational database management system, RDBMS for short. Databases are
great for storing data. An excellent use of databases can be found in what I call a "Conduit and Cable
Schedule". Creating the Database is a whole topic unto itself and I will not go into a lot of detail about it,
however, I will describe what this Conduit andCable Schedule is all about. Following is a screen shot of
the "Relationships" view of the Database we will be referencing :
You will notice this is a large and rather complex database structure, but over the next few months, we
will be going through it step by step and breaking it down. The tables we will be using today include the
LOC, CAB, CON and DWG tables. The LOC table is a list of locations, the CAB, a list of Cables, the CON,
a list of Conduits and the DWG table, a list of drawings.
In large electrical projects, there are lots and lots of pieces of equipment that need power, have control
wires and other such interconnections. When designing the electrical distribution systems it is nice to
have a method of referencing those conduits and wires between these locations. For instance, a
From a purely theoretical standpoint, every location in a job must be unique. We can't have two pumps
with the same name, no one would know which one we were referring to. By the same token, we can't
have two conduits with the same number. So, in the Access Database, we will have the CAB, CON and
LOC tables with indexes that prevent the generation of records with duplicate names.
Interfacing that Database with AutoCAD has been on my wish list for a few years, with the help of
Kenny Ramage and the rest of the gang here at Afralisp and Cad Encoding, I've gotten up the courage
to tackle just that. Ok, so let's begin.
Virtually Everything I do will be done from within Microsoft Access. The biggest question I have had to
ask myself is which application to write the code in. I could Write the application in Access and have
Access talk to AutoCAD, or I could write the code in AutoCAD and have AutoCAD talk to Access. I
chose the former over the latter for the simple reason that I have thousands and thousands of lines of
code written in Access to make the Conduit and Cable Schedule Work. I didn't really want to reinvent
the wheel, so there it is. Also, for compatibility issues, I am working in AutoCAD 2002 and Microsoft
Access 97. While there shouldn't be a big difference between versions, there may be.
My First step in this little shindig was to create a new class module to contain all of the code for the
AutoCAD interface. Once the new class is created, at the top, add the following lines of code :
Option Compare Database
Option Explicit
Private WithEvents objACAD As AcadApplication
Private objDoc As AcadDocument
Private Appexists As Boolean
The "Option Compare Database and the "Option Explicit" tell the Access App to first use the Database
default for comparing strings, etc and secondly to force the dimensioning of all variables.
That third line is a big one. It defines the interface for the AutoCAD Application. The "WithEvents"
keyword allows Access to generate Event Handlers for all of the Events AutoCAD exposes. For
instance, when a new drawing is opened, Access will know about it. The objDoc variable gives us a
direct reference to the Autocad Document which is a drawing. Finally, we define a boolean value for
internal use that makes sure the App Exists before we try to use it.
Please note, this is not an actual object, but a class. In order to create the object, we have to define an
object variable as this class and instantiate it. In the case of the Access Application, I have a global
variable called "objACAD" defined that is instantiated when the Access Application starts (it is
instantiated when a splash form comes up This allows any and all objects within the Application to
incorporate Autocad information into the data.)
When the class is instantiated, the "Class_Initialize" Event is executed. The code for this follows:
Private Sub Class_Initialize()
On Error Resume Next
Set objACAD = GetObject(, "Autocad.Application")
AppExists = True
If objACAD Is Nothing Then
Set objACAD = CreateObject("AutoCad.Application")
If objACAD Is Nothing Then Appexists = False
End If
Using an Exhaust Fan as an example, there are power conductors that go from a Motor Control Center
(MCC) to an Exhaust Fan Disconnect (EF-DISC). Then there are Power conductors to go from EF-DISC
to the Exhaust Fan (EF). Finally, there are control conductors that go from the MCC to a Processor
Panel (PP) that indicate if the EF is Running, Faulted, etc. Schematically, it would look like this :
Notice the cable numbers. This is a cable numbering system I have come up with that seems to work
reasonably well. Each cable is defined by the piece of equipment's name (in this case, EF). The second
part, the P01, P02, and C01 define the types of cables they are, Power, Control, Signal, Data,Fiberoptic,
etc. So, our Cable Table contains a list of all the Cable Names (each being unique). Now lets take a look
at this schematic from the point of view of construction. Below is a floor plan showing the location of
each of these pieces of equipment.
Notice there is more to this than just the equipment listed in the schematic. From a construction point
of view, I have an additional pull box located on the west well (north is up) The conduit goes from MCC
to PB-1 Then a conduit from PB-1 to EF-DISC. Finally, a conduit from EF-DISC to EF. Numbering the
conduits, we get the plan shown below Notice, the cable EFC01 is contained in both Conduit 1 and
Conduit 2.
Now that we have an idea of what the conduit and cable schedule will contain, lets take a look at
interfacing it with AutoCAD. Something that would be nice to have is an ability to select a location in the
database and have AutoCAD automatically open the drawing and zoom to the location. In pseudo code,
it would be something like:
Given a Selected Location in the Database,
Open Drawing Containing Location
Find Autocad Entity that is the location
Get Boudning Box of Entity
Zoom to bounding box
Complete.
Two important pieces of information are stored in the Location Table that will help in this endeavor.
First, is an index that is the Drawing, second is the Handle of the Entity in that Drawing.
How do we obtain those two pieces of information? . .Well, lets look at some pseudocode for that one:
● 6. Complete.
This is a screen shot of the "Location" Form. There are many fields in
this form that are of little consequence to us here. The fields we are
most concerned with are the Handle, DWGID and the button next to it
as well as the "Show Item" command button.
Lets take a look at the code behind the button next to the Handle Text
box.
Private Sub cmdGetHandle_Click()
Dim col As Collection
Dim ent As AcadEntity
Dim strDWG As String
Set col = objACAD.GetHandle
If col.Count = 0 Then Exit Sub
Set ent = col.Item(1)
txtHandle = ent.Handle
strDWG = ent.Document.Path & "\" & ent.Document.name
txtDWGID = FindDrawing("filename", strDWG).DWGID
End Sub
Similar to our pseudo code, we call a function from our ojbACAD class called GetHandle. Notice the
return value for the GetHandle Function is a Collection. In our current example, we only want one entity.
However, there are other uses for this function. Namely, when routing cables through conduits, I can
select all the conduits and pull boxes the cable goes through and the Database will be able to add the
cable to all of those items.
Public Function GetHandle() As Collection
Dim objDoc As Object
Dim col As Collection
Dim ob As AcadEntity
Dim str As String
Dim pt As Variant
Dim str As String
Dim fname As String
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Finding Files
One use of the Dir$ function is to determine whether a file exists. If you try to open a database or
access a file that does not exist, an error occurs. However, you can use Dir$ first to check for a files
existence before opening it, as in the following example :
If Dir$("C:/MYFILE.DWG" = " " Then
Msgbox "The file was not found. Please try again!"
End If
The Dir$ function returns the filename without the full path if the specified file is found, or it
returns an empty string if no files were found. The preceding line of code displays a message box if
MYFILE.DWG does not exist in the root directory of drive C. If the file does exist, the string
"myfile.dwg" is returned. To make things even simpler, you can create a generic function that
returns a Boolean value "True" if the given file exists.
Public Function bFileExists (Sfile As String) As Boolean
Suppose that your C:/DRAWINGS directory contains several drawings with a DWG extension. The
path used to retrieve these files with the Dir$ function would be C:/DRAWINGS/*.DWG. You can
use the following lines of code to retrieve the filenames and add them to a list box :
sNextFile As String
sNextFile = Dir$("C:/DRAWINGS/*.DWG")
Caution : When you use Dir$ in a loop, always exit the loop after an empty string is returned. If you
try to make another call to Dir$ with no arguments, a runtime error occurs.
The second, optional parameter of the Dir$ function is used to provide additional conditions
(beyond the specified path) with which to select files. For example, using the constant "vbDirectory"
returns only the subdirectories (or folders) in the specified path. The constant "vbVolume" causes
Dir$ to return the specified drive's volume label. The available constants are
summarized below :
Constant Value Purpose
vbNormal 0 (Default Value)
vbHidden 2 Include Hidden Files
vbSystem 4 Include System Files
vbVolume 8 Return Drive Volume Label
vbDirectory 16 Display SubDirectories
vbReadOnly 1 Include read-only files
Note : Constants can be added together if you want to use more than one. For example, the
following code finds the system, hidden and read only file IO.SYS on a machine :
debug.Print Dir$("C:/IO.SYS" , vbHidden+vbSystem+vbReadOnly)
Note that the "vbHidden" constant refers to a file's attributes and not the Windows Explorer option
that hides certain file types.
Copying Files
The "FileCopy" command has the limitation that you cannot use wildcards to
specify multiple files. "FileCopy" can copy files locally or over a network, as shown in the
following example :
'The following line copies a file while changing its name :
FileCopy "D:\DRAWING\TEST.DWG", "C:\BACKUP\TEST-BACK.DWG"
'The following lines of code use a network path for the source file :
Dim sDest As String
Dim sSource As String
sSource = "\\MYSERVER\DRAWINGS\TEST.DWG"
sDest = "C:\BACKUP\TEST-BACK.DWG"
Deleting Files
Visual Basic also allows you to delete files by using the "Kill" statement. "Kill"
can use wildcards to specify multiple files, as in the following example :
Kill "D:\DRAWINGS\*.DWG"
Renaming Files
The "Name" statement is like the MS-DOS "RENAME" command but can be used on only one file
at a time "
Name oldname As newname
You can also use "Name" like the "MOVE" command in MS-DOS if the specified paths are
different :
'Moves the files to a new directory
MkDir "C:\BACKUP\TEST-BACK.DWG"
Name "D:\DRAWING\TEST.DWG" As "C:\BACKUP\TEST-BACK.DWG"
In the preceding example,note the "MkDir" statement, which you have probably guessed is used to
create a new directory. The "MkDir" and "RemDir" statements add and remove directories.
Option Explicit
Sub Backup()
Exit Sub
FileCopyError:
MsgBox "There was a problem copying the Drawings"
End
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Error Trapping
As you are writing your code, Visual Basic informs you of syntactical errors.
However, once the program is running, you may encounter unexpected runtime errors in many circumstances.
For example, suppose you try to open a text file that the user has deleted.
When a compiled program has an error like this, an error message is displayed and the program ends.
Although you cannot predict and write code for every possible type of error,
"File Not Found" errors are fairly easy to handle. If you do not write code to work around the error, you can at
least provide a message that makes more sense before ending the program.
The most common way to handle error conditions is to use Visual Basic's "On Error" statement. The "On Error"
statement interrupts the normal flow of your program when
an error occurs and begins executing your error handling code. A typical
use is as follows :
On Error Goto FileOpenError
When this statement is executed, any errors that occur in subsequent statements cause Visual Basic to stop normal
line-by-line execution and jump to the statement labeled as "FileOpenError".
Line labels in Visual Basic are similar to the line numbers of early BASIC. In Visual Basic, line labels can include
text if you want, but each label must be unique. They are followed by a colon (:), as in the following example :
Private Sub Form_Load ()
FileOpenError:
MsgBox "There was a problem opening the file. Stop for coffee!"
End
End Sub
In the preceding sample code, if the "Open" or "Line Input" statements cause an error, the statements starting at
the label "FileOpenError" are executed, causing the message to be displayed and ending the program.
You should note a few points about the sample code. First, note the location and style of the error handling routine.
It is usually placed near the end of the subroutine, with the label not indented to indicate a special section of code.
Second, and more important, note the "Exit Sub" statement after the "Open" statement. It is necessary to prevent
the error handler routine from executing even when the "Open" statement was successful.
In the preceding code example, you simply end the program if an error occurs.
However, you can handle the error in several (better) ways :
● Exit the subroutine after informing the user of the error, and allow the program
to continue running with limited functionality.
● Resume execution with the next statement following the error.
FileOpenError:
Dim sMessage As String
sMessage = "There was a problem opening the file. " & VbCrLf
sMessage = sMessage & "Press Retry to try again, or Cancel to quit."
End Sub
You can though use "On Error Resume Next" if you are trying to connect to AutoCAD
from an external Visual Basic or other application :
'if error carry on with next line
On Error Resume Next
'open AutoCAD
Set acadApp = CreateObject("Autocad.Application.16")
'inform user
MsgBox Err.Description
'exit application
Exit Sub
End If
End If
Next, set the document variable to the Document object in the AutoCAD application. The Document object is
returned by the ActiveDocument property of the Application object :
Dim ThisDrawing as AcadDocument
Set ThisDrawing = acadApp.ActiveDocument
From this point on, use the "ThisDrawing" variable to reference the current AutoCAD drawing just like AutoCAD
VBA.
After an error has occurred, your code can find out more information about the error in several ways :
● Err - Contains a number that represents the error.
Hint : When you are writing an error handling routine with a message box, display the error number and
description in your message box to make troubleshooting easier.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This application will demonstrate how to connect AutoCAD and Outlook using VBA. It
will allow you to add a Task to Outlook along with a reminder time and a due time.
Special thanks to Randall Raath of VBDesign for this idea.
.ReminderSet = True
.ReminderPlaySound = True
.ReminderSoundFile = "C:\Windows\Media\Ding.WAV"
'Add the path to a .wav file on your computer.
.Save
End With
Set taskOutLook = Nothing
If you would like a copy of this module, just click here. Enjoy.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Usage :
Open the Powerpoint file dwg2slide.ppt.
Run the macro 'dwg2slide'.
Choose any file in the directory you wish to process.
Select 'O.K.' to proceed and sit back.
After a couple of minutes (depending on how many drawing files are in
the directory you choose), your slides will have been created.
Here is the coding for the entire application :
(Remember, this is written in Powerpoint VBA).
First create a module named Module1:
Public dirname As String
Sub Dwg2Slide()
Dim selname As String
Dim SelName1 As String
Dim InCounter As Integer
Dim InFoundpos As Integer
UserForm1.CommonDialog1.Flags = cdlOFNHideReadOnly
'switch off read only
UserForm1.CommonDialog1.ShowOpen
'open dialog box
selname = UserForm1.CommonDialog1.filename
'retrieve the file name
InCounter = 1
'initilize counter
InCounter = InFoundpos + 1
'increase the counter
Wend
UserForm1.Show
'show the dialog
End Sub
Next create a userform named Userform1. The following coding goes under the event procedures of
the userforms controls:
Private Sub CommandButton1_Click()
If Err Then
'if there is an error
MsgBox Err.Description
'inform user
Exit Sub
'exit application
End If
'End If
acadApp.Visible = True
'Make Autocad Visible
Me.Hide
'Hide the dialogue box
mylen = Len(filename)
'get the length of the filename
mylen = mylen - 4
'subtract the .DWG Extension
pViewport.ZoomExtents
'zoom to extents
sset.Select acSelectionSetAll
'select the whole drawing
acadDoc.Save
'save the drawing
End If
End If
filename = Dir
'get the next entry
Loop
'carry on looping
acadApp.Quit
'Close Autocad
sl = 1
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add _
(Index:=sl, Layout:=ppLayoutBlank).SlideIndex
'insert a new slide
ActiveWindow.Selection.SlideRange.Shapes.AddPicture _
(filename:=filename, LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, Left:=-2, Top:=58, Width:=727, _
Height:=423).Select
'import WMF File into slide
sl = 1 + sl
'increment the slide number
End If
End If
filename = Dir
'get the next entry
Loop
'carry on looping
End
End Sub
End Sub
If you would like a copy of this module, just click here. Enjoy.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The following code module sends a user defined string to the AutoCAD command line.
Theoretically, this means that you can run any AutoCAD command that you wish.
Copy and paste the following coding into a module in VBA and run any of the 4 sub- routines. The
four sub-routines available as examples are :
Thanks to Michael Hunter, ActiveCad, and Joe Sutphin for this Module and the idea. Sorry guys,
but it is to good not to spread around :-)
Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As String
End Type
Public Sub SendToCommandPrompt(strMessage As String) Dim DataStruct As COPYDATASTRUCT
DataStruct.dwData = 1 DataStruct.lpData = strMessage DataStruct.cbData = Len(strMessage) + 2 AppActivate
ThisDrawing.Application.Caption SendMessage GetForegroundWindow, WM_COPYDATA, 0, DataStruct End
Sub
Sub xplode() SendToCommandPrompt "explode" & vbCr & "last" & vbCr & vbCr End Sub
Sub DwfExport() SendToCommandPrompt "DWFOUT" & vbCr & vbCr & "A" & vbCr & "YES" & vbCr End
Sub
Sub Zoome() SendToCommandPrompt "ZOOM" & vbCr & "EXTENTS" & vbCr End Sub
Sub RunLisp() SendToCommandPrompt "(Load ""ALispFile"")" & vbCr & "ALispFile" & vbCr End Sub
If you would like a copy of this module, just click here. Enjoy.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
A lot of people now have E-Mail which makes the sharing of drawings a lot easier. But, not
everybody has got AutoCAD, so even if you E-Mail the drawing to them they still cannot open it.
You could fax it, but that has it's own problems.
Firstly, you must plot the drawing out to suit the size format of the fax machine,
or cut the drawing up into strips and fax it that way.
If you have a fax card and modem connected to your computer you can use a little bit of Visual
Basic to send the drawing to your fax.
First of all you need to set your fax as the default system printer.
Next, open AutoCAD and go to Preferences - Printers and set up a default system Printer. Finally,
open up the Fax VBA Application and change the Fax name to that of your Fax. That's it, you are
ready to Fax any drawing.
Here is the coding for the application :
Private Sub CommandButton1_Click()
ThisDrawing.Plot.PlotToDevice "WinFax"
'change the name of the Fax to suit
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This project demonstrates a method of extracting system variable data from AutoCAD and
importing it into Microsoft Excel.
The application calculates the length of time a user has spent in a drawing session and extracts this
data to a timesheet created in Excel. It then totals the daily drawing hours along with with the date,
the draughtsman's login name, the drawing number and the job number.
To use this VBA application, simply extract all of the files into your working
directory then load and run Timesheet.Lsp.
(If you have problems when writing or running this project, ensure that
the Microsoft Excel 8.0 Object Library is selected in your VBA References.)
After running the application, open the Excel file Timesheet.xls. You should have something
looking like this :
xlapp.Visible = True
'make Excel visible
xlapp.Windows("TIMESHEET.XLS").Visible = True
'make the workbook visible
'the 2 preceeding lines can be commented out if you
'do not want to see Excel in action
Rownum = 10
'set initial row number
Rownum = Rownum + 1
'increase the row number by one
Loop
'carry on looping
xlsheet.Cells(5, 2) = UCase(Username)
'enter Login Name
xlsheet.Cells(3, 2) = Date
'enter the date
xlbook.Close savechanges:=True
'save the changes in Excel
xlapp.Quit
'quit Excel
UserForm1.Hide
'hide the dialog box
Else
ThisDrawing.Save
'if Yes save the drawing
End If
ThisDrawing.Application.Quit
'close the drawing and exit AutoCAD
End Sub
End
'end the application
End Sub
ElapseTime = ThisDrawing.GetVariable("TDUSRTIMER")
'get the elapsed time
Dwgname = ThisDrawing.GetVariable("DWGNAME")
'get the drawing number
Username = ThisDrawing.GetVariable("LOGINNAME")
'get the login name
UserForm1.TextBox2.Text = UCase(Dwgname)
'display the drawing number
UserForm1.TextBox4.Text = UCase(Username)
'display the login name
UserForm1.TextBox5.Text = Date
'display the date
UserForm1.TextBox1.SetFocus
'set the focus to the Job No text box
UserForm1.TextBox1.SelStart = 0
'select the start of the text
UserForm1.TextBox1.SelLength = Len(UserForm1.TextBox1.Text)
'highlight the text
End Sub
You must also create a new module:
Sub timesheet ()
userform1.show
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(defun c:ldvb ()
;define function
(setvar "CMDECHO" 0)
;switch off command echo
(progn
;do the following
(setvar "FILEDIA" 0)
;switch off dialogue boxes
(command "_vbaload"
(findfile "yourproject.dvb"))
;load the project file
(command "_vbaunload")
;unload the file
(setvar "FILEDIA" 1)
;switch dialogues back on
);progn
);if
(setvar "CMDECHO" 1)
;switch command echo back on
(princ)
);defun
(princ)
;load clean
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
ssnew.Item(0).Update
End
End Sub
Sub UpdateAttrib(TagNumber As Integer, BTextString As String)
'This Sub Procedure tests the attribute data to check
'that is not a null value
Theatts(TagNumber).TextString = ""
'put a '-' place holder
Else
'if it is not empty
Theatts(TagNumber).TextString = BTextString
'use the attribute value
End If
End Sub
xlapp.Visible = True
'make Excel visible
xlapp.Windows("MATLIST.XLS").Visible = True
'make the workbook visible
'the 2 preceeding lines can be commented out if you
'do not want to see Excel in action
xlsheet.Cells(2, 1) = UserForm1.txt1.Text
xlsheet.Cells(3, 1) = UserForm1.txt8.Text
xlsheet.Cells(4, 1) = UserForm1.txt15.Text
xlsheet.Cells(5, 1) = UserForm1.txt22.Text
xlsheet.Cells(6, 1) = UserForm1.txt29.Text
UserForm1.txt6.Text = xlsheet.Cells(2, 6)
UserForm1.txt13.Text = xlsheet.Cells(3, 6)
UserForm1.txt20.Text = xlsheet.Cells(4, 6)
UserForm1.txt27.Text = xlsheet.Cells(5, 6)
UserForm1.txt34.Text = xlsheet.Cells(6, 6)
UserForm1.txt36.Text = xlsheet.Cells(7, 6)
'retrieve the calculated attribute values
xlbook.Close savechanges:=True
'save the changes in Excel
xlapp.Quit
'quit Excel
End Sub
Set ms = doc.ModelSpace
'set reference to model space
BlkG(0) = 2
'group code 2 for block name
TheBlock(0) = "MATLIST"
'the name of the attribute block
Theatts = ssnew.Item(0).GetAttributes
'get the attributes
UserForm1.txt1.Text = UCase(LTrim(Theatts(0).TextString))
'get the title attribute
'clear any leading spaces and
'convert to uppercase
UserForm1.txt2.Text = UCase(LTrim(Theatts(1).TextString))
UserForm1.txt3.Text = UCase(LTrim(Theatts(2).TextString))
UserForm1.txt4.Text = UCase(LTrim(Theatts(3).TextString))
UserForm1.txt5.Text = UCase(LTrim(Theatts(4).TextString))
UserForm1.txt6.Text = UCase(LTrim(Theatts(5).TextString))
UserForm1.txt7.Text = UCase(LTrim(Theatts(6).TextString))
UserForm1.txt8.Text = UCase(LTrim(Theatts(7).TextString))
UserForm1.txt9.Text = UCase(LTrim(Theatts(8).TextString))
UserForm1.txt10.Text = UCase(LTrim(Theatts(9).TextString))
UserForm1.txt11.Text = UCase(LTrim(Theatts(10).TextString))
UserForm1.txt12.Text = UCase(LTrim(Theatts(11).TextString))
UserForm1.txt13.Text = UCase(LTrim(Theatts(12).TextString))
UserForm1.txt14.Text = UCase(LTrim(Theatts(13).TextString))
UserForm1.txt15.Text = UCase(LTrim(Theatts(14).TextString))
UserForm1.txt16.Text = UCase(LTrim(Theatts(15).TextString))
UserForm1.txt17.Text = UCase(LTrim(Theatts(16).TextString))
UserForm1.txt18.Text = UCase(LTrim(Theatts(17).TextString))
UserForm1.txt19.Text = UCase(LTrim(Theatts(18).TextString))
UserForm1.txt20.Text = UCase(LTrim(Theatts(19).TextString))
UserForm1.txt21.Text = UCase(LTrim(Theatts(20).TextString))
UserForm1.txt22.Text = UCase(LTrim(Theatts(21).TextString))
UserForm1.txt23.Text = UCase(LTrim(Theatts(22).TextString))
UserForm1.txt24.Text = UCase(LTrim(Theatts(23).TextString))
UserForm1.txt25.Text = UCase(LTrim(Theatts(24).TextString))
UserForm1.txt26.Text = UCase(LTrim(Theatts(25).TextString))
UserForm1.txt1.SetFocus
UserForm1.txt1.SelStart = 0
UserForm1.txt1.SelLength = Len(UserForm1.txt1.Text)
'set the focus to the drawing title and highlight it
Else
'if no attribute title block is found
ThisDrawing.SelectionSets("TBLK").Delete
End
'end the application
End If
ThisDrawing.SelectionSets("TBLK").Delete
End Sub
Sub matlist()
UserForm1.Show
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This is a sample VBA routine written for AutoCAD Rel 14, 2000, 2000i and 2002.
This application will demonstrate how to import and export Title Block attribute data, to and from an Access 2000
database.
Unzip the files Tblock2002.dvb, Tblock2002.Lsp, Tblock.Dwg and Tblock.Mdb to your working directory.
Insert the Tblock.Dwg. as a block into any drawing.
(If you have problems when writing or running this projects, ensure that the Microsoft DAO 3.6 Object Library is
selected in your VBA References.)
UpdateAttrib 0, UserForm1.TextBox1.Text
UpdateAttrib 1, UserForm1.TextBox2.Text
UpdateAttrib 2, UserForm1.TextBox3.Text
UpdateAttrib 3, UserForm1.TextBox4.Text
UpdateAttrib 4, UserForm1.TextBox5.Text
'get the attribute values
ssnew.Item(0).Update
'update the attribute block
End
End Sub
Theatts(TagNumber).TextString = "-"
'put a '-' place holder
Else
'if it is not empty
Theatts(TagNumber).TextString = BTextString
'use the attribute value
ThisDrawing.SelectionSets.Item("TBLK").Delete
'delete the block
End If
End Sub
End Sub
DrgNumber = UserForm1.TextBox2.Text
'get the drawing number
'if the database is not an Access dadtabase use the following line
'Set dbInfo = OpenDatabase("
'C:\DATABASE PATH\", False, False, "dBASE III;C:\DATABASE PATH\TBLOCK.DBF;")
UserForm1.Hide
'hide the dialogue box
Response = MsgBox(Msg & Chr(13) & Chr(10) & Msg1, Style, Title)
'display the message box
UserForm1.rsInfo.Edit
'open the database for edit
'-------------------
'this section is for AutoCAD 14/2000
UserForm1.rsInfo("TITLE") = UserForm1.TextBox1.Text
UserForm1.rsInfo("DRGNO") = UserForm1.TextBox2.Text
UserForm1.rsInfo("DATE") = UserForm1.TextBox3.Text
UserForm1.rsInfo("DRAWN") = UserForm1.TextBox4.Text
UserForm1.rsInfo("SCALE") = UserForm1.TextBox5.Text
'get the field values
'--------------------
'For AutoCAD 2000i/2002 replace the preceding section with this :
'UserForm1.rsInfo.Fields("TITLE") = UserForm1.TextBox1.Text
'UserForm1.rsInfo.Fields("DRGNO") = UserForm1.TextBox2.Text
'UserForm1.rsInfo.Fields("DATE") = UserForm1.TextBox3.Text
'UserForm1.rsInfo.Fields("DRAWN") = UserForm1.TextBox4.Text
'UserForm1.rsInfo.Fields("SCALE") = UserForm1.TextBox5.Text
'get the field values
'---------------------
UserForm1.rsInfo.Update
'update the database
Else
'if the user does not want to update
UserForm1.Show
'reinstate the dialogue
End If
Else
'if the drawing number has not been found
Response = MsgBox(Msg & Chr(13) & Chr(10) & Msg1, Style, Title)
'display the message box
If Response = vbYes Then
'if the user wants to enter the drawing details
UserForm1.rsInfo.AddNew
'open the dtabase to add a new record
'-------------------
'this section is for AutoCAD 14/2000
UserForm1.rsInfo("TITLE") = UserForm1.TextBox1.Text
UserForm1.rsInfo("DRGNO") = UserForm1.TextBox2.Text
UserForm1.rsInfo("DATE") = UserForm1.TextBox3.Text
UserForm1.rsInfo("DRAWN") = UserForm1.TextBox4.Text
UserForm1.rsInfo("SCALE") = UserForm1.TextBox5.Text
'get the field values
'--------------------
'For AutoCAD 2000i/2002 replace the preceding section with this :
'UserForm1.rsInfo.Fields("TITLE") = UserForm1.TextBox1.Text
'UserForm1.rsInfo.Fields("DRGNO") = UserForm1.TextBox2.Text
'UserForm1.rsInfo.Fields("DATE") = UserForm1.TextBox3.Text
'UserForm1.rsInfo.Fields("DRAWN") = UserForm1.TextBox4.Text
'UserForm1.rsInfo.Fields("SCALE") = UserForm1.TextBox5.Text
'get the field values
'---------------------
UserForm1.rsInfo.Update
'update the database
UserForm1.Show
'reinstate the dialogue box
Else
'if the user does not want to enter the drawing details
UserForm1.Show
'reinstate the dialoge box
End If
End If
Set ms = doc.ModelSpace
'set reference to model space
BlkG(0) = 2
'group code 2 for block name
TheBlock(0) = "TBLOCK"
'the name of the attribute block
Theatts = ssnew.Item(0).GetAttributes
'get the attributes
UserForm1.TextBox1.Text = UCase(LTrim(Theatts(0).TextString))
'get the title attribute
'clear any leading spaces and
'convert to uppercase
UserForm1.TextBox2.Text = UCase(LTrim(Theatts(1).TextString))
'get the drawing number attribute
'clear any leading spaces and
'convert to uppercase
UserForm1.TextBox3.Text = Date
'get todays date
UserForm1.TextBox4.Text = UCase(LTrim(Theatts(3).TextString))
'get the draughtsmans name
'clear any leading spaces and
'convert to uppercase
UserForm1.TextBox1.SetFocus
UserForm1.TextBox1.SelStart = 0
UserForm1.TextBox1.SelLength = Len(UserForm1.TextBox1.Text)
'set the focus to the drawing title and highlight it
Else
'if no attribute title block is found
End
'end the program
End If
End Sub
Sub TBlock()
UserForm1.Show
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
End Sub
Const PI = 3.141592654
'define PI as constant
Me.Hide
'hide the dialogue
Case 0
'if case index = 0
Height = 152.4
'set height
Width = 152.4
'set width
t1 = 6.1
'set web thickness
t2 = 6.8
'set flange thickness
r1 = 7.6
'set root radius
Case 1
Height = 157.5
Width = 152.9
t1 = 6.6
t2 = 6.4
For i = 0 To 2
'convert x, y & z from variables to doubles
inPntv(i) = inPnt(i)
Next
Dim pt1 As Variant
'declare variants
ptArray(0) = pt1(0)
'set the array points
ptArray(1) = pt1(1)
ptArray(2) = pt2a(0)
ptArray(3) = pt2a(1)
ptArray(4) = pt2b(0)
ptArray(5) = pt2b(1)
ptArray(6) = pt3(0)
ptArray(7) = pt3(1)
ptArray(8) = pt4(0)
Rot = CDbl(Txb1.Text)
'get the rotation angle and convert
'to double
End Sub
End Sub
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Me.Hide
'hide the dialogue box
If Err Then
'if there is another error
MsgBox Err.Description
'inform user
Exit Sub
'exit application
End If
End
'if No end application
Else
acadDoc.Save
'if Yes save the drawing
End If
End If
sc = CDbl(TextBox1.Text)
'get the scale and convert to double
DrgSheet = "E"
'set first letter of drawing sheet
templateFileName = "acadeng.dwt"
'set the relevant template file
End If
Case 0
'if the index is 0 (first item)
DrgSize = "A0"
'set the drawing size
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 1189# * sc
newLimits(3) = 841# * sc
'set the limits
Case 1
DrgSize = "A1"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 841# * sc
newLimits(3) = 594# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 2
DrgSize = "A2"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 594# * sc
newLimits(3) = 420# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 3
DrgSize = "A3"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 420# * sc
newLimits(3) = 297# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 4
DrgSize = "A4"
newLimits(0) = 0#
newLimits(1) = 0#
acadDoc.Limits = newLimits
'set drawing limits
pViewport.ZoomExtents
'zoom to extents
Call acadDoc.SetVariable("Regenmode", 1)
'set Regenmode
Call acadDoc.SetVariable("Tilemode", 1)
'set Tilemode
oldTextStyle.Height = 3.5 * sc
'set Text Height
InsertionPoint(0) = 0
InsertionPoint(1) = 0
InsertionPoint(2) = 0
'set the insertion point
End
End Sub
End Sub
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Usage :
This program not only inserts a chosen type and size of drawing sheet into your drawing, but also sets
your text height and dimension scaling to suit the scale factor.
You can even preset your own system variables within the program. Go for it, it's yours for ever and
ever to do with as you wish.
alsetup : dialog {
label = "CAD Encoding Drawing Setup";
: row {
: boxed_radio_column {
label = "Choose Sheet";
: radio_button {
label = "&Engineering Sheets";
key = "rb1";
value = "1";
}
: radio_button {
label = "&Architectural Sheets";
: boxed_radio_column {
label = "Choose Size :";
: radio_button {
label = "A&0 - 1189 x 841";
key = "rb6";
value = "1";
}
: radio_button {
label = "A&1 - 841 x 594";
key = "rb7";
}
: radio_button {
label = "A&2 - 594 x 420";
key = "rb8";
}
: radio_button {
label = "A&3 - 420 x 297";
key = "rb9";
}
: radio_button {
label = "A&4 - 297 x 210";
key = "rb10";
}
}
}
: edit_box {
label = "&Enter Drawing Scale :" ;
key = "eb1" ;
edit_width = 8 ;
}
ok_cancel ;
: paragraph {
: text_part {
label = "Designed and Created";
}
: text_part {
label = "by CAD Encoding";
}
And next, here's the AutoLisp coding. No Visual Lisp this time, just plain AutoLisp. ("Phew," I can hear a
lot of you saying, wiping your delicate brows in relief.)
Copy and paste this into Notepad and save it as "ALSetup.lsp."
);cond
);progn
);if
;finish clean
(princ)
);defun
;;;---------------------------
(mode_tile "eb1" 2)
);defun
;;;--------------------------
;load clean
(princ)
Store both files and the drawing sheet files in a directory within your AutoCAD search path. Now type
(load "ALSetup") at the AutoCAD command prompt, and then "ALSetup" to run the setup program.
On the next page we'll have a look at doing the same thing using VBA, but this time we'll make use of
drawing template files.
Home Page II
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Usage :
Select your Drawing Sheet type first,
then the Drawing Size, select a Scale
and then the OK button and away you
go.
To use your own template drawings in
this routine, please refer to the Readme
file which is included within the
downloadable drawing sheet zip file.
(The download link is at the bottom of
this page )
As for the AutoLisp version, you can customise this program to your little hearts desire.
Right, let's have a look at a wee bit of coding. Fire up AutoCAD and open a new Project in the Visual Basic Editor.
First you need to insert a new UserForm keeping the default name. (UserForm1)
Now add the following controls, naming them as shown :
● Button - "cmdOk"
● Button - "cmdCancel"
● Frame containing 4 Option Buttons - "Opt1", "Opt2", "Opt3" and "Opt4".
● Listbox - "Listbox1"
● Edit Box - "Textbox1"
Option Explicit
'------------------------------------------------
'declare variables
Dim acadApp As Object
Dim acadDoc As Object
Dim doc As Object
Dim templateFileName As String
Dim DrgSheet As String
'inform user
MsgBox Err.Description
'exit application
Exit Sub
End If
Else
End If
End If
End If
Case 1
DrgSize = "A1"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 841# * sc
newLimits(3) = 594# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 2
DrgSize = "A2"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 594# * sc
newLimits(3) = 420# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 3
DrgSize = "A3"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 420# * sc
newLimits(3) = 297# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
Case 4
DrgSize = "A4"
newLimits(0) = 0#
newLimits(1) = 0#
newLimits(2) = 297# * sc
newLimits(3) = 210# * sc
Set oldTextStyle = acadDoc.ActiveTextStyle
'zoom to extents
ZoomExtents
'set Ltscale
Call acadDoc.SetVariable("Ltscale", sc * 10)
'set Dimscale
Call acadDoc.SetVariable("Dimscale", sc)
'set Regenmode
Call acadDoc.SetVariable("Regenmode", 1)
'set Tilemode
Call acadDoc.SetVariable("Tilemode", 1)
End
End Sub
'-------------------------------------------------
'--------------------------------------------------
End Sub
Sub VbaSetup()
UserForm1.Show
End Sub
To download the AutoLisp and VBA source coding, just click here.
Home Page I
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
CHL.DVB--Change Layer
CHLT.DVB-Change Linetype
CHC.DVB--Change Color
***TOOLBARS
**UTILITIES
TB_Utility [_Toolbar("Utilities", _Floating, _Show, 0, 0, 1)]
TB_ChLayer [_Button("Change Layer", "chl.bmp", "ICON_32_BLANK")]^C^C^P+
(cond ((null C:UTILS) (prompt "Please Wait...")(load "UTILS"))) CHL
TB_ChLType [_Button("Change Line Type", "chlt.bmp", "ICON_32_BLANK")]^C^C^P+
(cond ((null C:UTILS) (prompt "Please Wait...")(load "UTILS"))) CHLT
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This application is the perfect example of how something so simple can be so powerful. My immediate reaction on
reading this article and then running the coding was, "Why didn't I think of that?" I implemented it into my office
so quickly you wouldn't believe it.
Have you ever wondered why drawings can contain many layers, but objects such as "text",
"dimensions" and "hatch" do not always end up on the correct layers? This article addresses a
potential solution to that problem. First, I talk briefly about layer standards and show you how to create
a small VBA project for AutoCAD r14.01 or 2000 to control layers.
Layer Standards
Several times in the past, I have been asked by new users, "Why doesn't AutoCAD put text objects on
the text layer and hatch objects on a hatch layer, etc?" The answer is that Autodesk has designed
AutoCAD to give users unrestricted flexibility with layer names and to allow companies to create or
adopt any layer standard. Unfortunately, this flexibility of open-architecture layer names within
AutoCAD has allowed many an AutoCAD user to recklessly create layer names. Sometimes, it seems,
layer names are chosen according to what pops into the user's head while staring at the AutoCAD layer
dialogue box! And after several other users in the same company use these layer names, the results are
then called the "company layer standards".
There are many recognized layer standards in existence, such as AIA, Master Format, British BSD, etc.
that companies can adopt, but it seems to be more trendy for companies to make up their own layer
names and standards on the fly. The rationale seems to be "Those other existing layer standards could
not possibly accommodate the type of work that our company does. " How many times have you come
across a drawing (done by someone else, of course) containing layers called dim, dimension, and
dimensions? The purpose of this small VBA project is to create a mini layer-manager that enforces
layers for "text", "hatch" and "dimension" objects as they are created in a drawing. Text goes on to a
layer called "text", hatch patterns are placed on a layer called "hatch", and dimensions are placed on a
layer called "dim". Seems almost too obvious! Sure, this is a rather simplistic way of managing layers
for objects, but it works! For those interested in modifying the code to fit your own company layer
standard or for working with multiple disciplines, take a look at the section called "Extending the Code"
later in the article.
Place this coding into a VBA Module and save it as DrawMan.dvb. Then add it to your startup suitcase.
' Using Option Explicit -- you must explicitly declare all variables using the
' Option Explicit is a great way to make sure you do not have wonkie typo mistakes
Option Explicit
' if the current layer is not TEXT then set up the TEXT
objCurrentLayer.Color = acCyan
objCurrentLayer.LayerOn = True
objCurrentLayer.Freeze = False
ThisDrawing.ActiveLayer = objCurrentLayer
End If
' if the current layer is not HATCH then set up the HATCH
objCurrentLayer.Color = 8
objCurrentLayer.LayerOn = True
objCurrentLayer.Freeze = False
objCurrentLayer.Lock = False
ThisDrawing.ActiveLayer = objCurrentLayer
End If
objCurrentLayer.Color = acCyan
objCurrentLayer.LayerOn = True
objCurrentLayer.Freeze = False
ThisDrawing.ActiveLayer = objCurrentLayer
End If
End Sub
' Check for the folowing cases of the AutoCAD command that has just ended.
' make the current active AutoCAD layer the previously saved layer.
ThisDrawing.ActiveLayer = objPreviousLayer
End Select
End Sub
Would you like the coding for this routine? Then put one leg in the air,
close one eye, scream as loud as you can and click here. Enjoy.......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Save Manager
The Autosave feature in AutoCAD does not save the drawing you are working on, but saves a copy of your drawing
to a directory stored in the Savefilepath system variable. This drawing does not have the same name as your
drawing file and can be overwritten with subsequent Autosaves. Here's a little VBA application which I wrote that
will save your drawings at a user determined interval. (or very close.) It basically takes the time from the system
clock and stores it in one of the User system variables. Every time you select "Line," "Pline," or "Zoom," the
application checks to see if 15 minutes have passed. If it hasn't, it does nothing. If it has, it saves the drawing and
then resets the stored time to the system time. (Phew!)
Stick this coding in a module, save it as "SaveMan.dvb," and add it to your startup suitcase.
Option Explicit
Dim OldTime
Dim NewTime
OldTime = ThisDrawing.GetVariable("Useri2")
If OldTime = 0 Then
'then end
End
End If
ThisDrawing.Save
'and then reset Useri2
End If
End Select
End Sub
If you wish, you can download the source coding here. (4Kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
● Update the attribute data with the new information entered into the dialogue box.
Alright, I admit that it's not much of a title block, but it's enough to give you the general idea.
Load run run the macro.
This dialogue should appear :
Change some of the data and then press the "OK" button.
The title block data should be updated. Clever hey?
'All Tutorials and Code are provided "as-is" for purposes of instruction and
'utility and may be used by anyone for any purpose entirely at their own risk.
'Please respect the intellectual rights of others.
'All material provided here is unsupported and without warranty of any kind.
'No responsibility will be taken for any direct or indirect consequences
'resulting from or associated with the use of these Tutorials or Code.
'*******************************************************************************
' AfraLisp
' http://www.afralisp.com
' [email protected]
' [email protected]
'*******************************************************************************
'This application will extract attributes from a block and display them in a
'dialog box. The attributes will then be updated.
Option Explicit
End
End Sub
End
End Sub
Else
'no attribute block, inform the user
MsgBox "No Title Block Attributes - Use Manual Edit..", vbCritical, "AfraLisp Title Block"
End
End If
Exit Sub
Err_Control:
End
End Sub
Tatts(TagNumber).TextString = ""
Else
Tatts(TagNumber).TextString = BTextString
End If
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Alright, I admit that it's not much of a title block, but it's enough to give you the general
idea.
Now, at the command prompt type (load "Addat") and then enter.
Now, type "Addat" and press enter again.
This dialogue should appear :
Change some of the data and then press the "OK" button.
The title block data should be updated. Clever hey?
You can expand on this routine as much as you like using the following coding as a
template.
Hint : You don't have to display all the attribute data stored in a block. Only display what
you want the user to modify. As well, you can split your data over multiple dialogue
boxes. eg. One for title block, one for revisions, one for reference drawings, etc. All the
data though is contained in one attribute.
Here's the coding, DCL code first :
attab : dialog {
label = "Drawing Title Block";
: edit_box {
label = "&Drawing Number";
key = "eb1";
edit_width = 30;
}
: edit_box {
label = "&Revision";
key = "eb2";
edit_width = 30;
}
: edit_box {
label = "Drawn &By";
key = "eb3";
edit_width = 30;
}
: edit_box {
label = "D&ate";
key = "eb4";
edit_width = 30;
}
: edit_box {
label = "&Title";
key = "eb5";
edit_width = 30;
}
ok_cancel ;
:text_part {
label = "AfraLisp - http://www.afralisp.com";
}
And now the AutoLisp coding with plenty of in-line comments to assist you :
;CODING STARTS HERE
;
;All Tutorials and Code are provided "as-is" for purposes of instruction and
;utility and may be used by anyone for any purpose entirely at their own risk.
;Please respect the intellectual rights of others.
;All material provided here is unsupported and without warranty of any kind.
;No responsibility will be taken for any direct or indirect consequences
;resulting from or associated with the use of these Tutorials or Code.
;*******************************************************************************
; AfraLisp
; http://www.afralisp.com
; [email protected]
; [email protected]
;*******************************************************************************
;This application will extract attributes from a block and display them in a
;dialog box. The attributes will then be updated. Attab.dcl and Attab.dwg are
;required and must be within the AutoCAD search path.
;
;Usage : Open Attab.dwg then load and run Attab.lsp.
;*******************************************************************************
);if
);while
);if
);progn
);if
;finish clean
(princ)
);defun
;;;**********************************************************
;check it exists
(if (not (new_dialog "attab" dcl_id))
(exit)
);if
(progn
);progn
);if
(princ)
);defun
;;;***********************************************************
);defun
;;;**********************************************************
;load clean
(princ)
;;;**********************************************************
;
;CODING ENDS HERE
Please note that there is no error checking in this routine and I have left all variables as
global to assist you in checking their values whilst you are analyzing the code.
If you are too lazy to type, and don't know how to copy and paste, you can download the
coding and sample drawing by very gently placing your cursor here and clicking once.
"Ouch, I did say gentle!!!!
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
In this article, we are going to have a look at extracting information from AutoCAD and displaying the
results in an HTML file.
Just to be clever, and to keep everybody happy, we'll be writing the coding using VBA, AutoLisp, Visual
Lisp and last but not least VB. Each of the routines will be slightly different to give you an idea of the
capabilities of each language.
Insert a Userform and add a listbox and two buttons, retaining their default names :
● UserForm1
● ListBox1
● CommandButton1
● Commandbutton2
Add the following coding to the General Declarations section :
(I recommend you download the source coding for this project as word-wrapping can cause major
problems. The download link is at the end of Page IV.)
Option Explicit
'-----------------------------------------------------
Public AllLayers As AcadLayers
'-----------------------------------------------------
'error control
Exit_Here:
Exit Sub
Err_Control:
MsgBox Err.Description
End Sub
'----------------------------------------------------
End
End Sub
'---------------------------------------------------
'error control
Exit_Here:
Exit Sub
Err_Control:
MsgBox Err.Description
Resume Exit_Here
End Sub
Sub AllLayers()
UserForm1.Show
End Sub
On the next page we'll have a look at something similar, but this time using AutoLisp.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
I'd like to thank Andy Canfield(Cornbread) for his ideas and input into this routine. Andy wrote about
90% of this program and in fact, gave me the initial idea for this article. I've changed a couple of things
and tidied it up for publishing, but Andy did the major work. Any errors or typos are from my desk.
Right, enough waffle, lets get on with it. Copy and paste this into Notepad and then save it as
"Dwf-Html.lsp."
(progn
(arxload "doslib2k")
(progn
);progn
);if
);progn
);if
;give it a title
(write-line "<h1>AutoCAD and HTML</h1><hr>" fn)
);end repeat
);progn
);if flag
;finish clean
(princ)
);defun
;load clean
(princ)
As I mentioned earlier, we make use of the DosLib function "dos_filem" to allow the user to select the
DWF files that he/she/it wants to process.
The "dos_filem" function displays a file open dialog box that allows for multiple file selection. The
function returns a list of filenames if successful. The first element of the list is a qualified path to the
selected directory. eg.
(setq thedir (car thelist))
returns a list of file names. Do yourself a favour and read the help file that comes with DosLib as you'll
find a lot of useful functions that will make your AutoLisp coding a lot easier.
Right, now let's have a look at doing something with HTML using Visual Lisp.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Okey dokey. Dave is the author of this nice little program written using Visual Lisp that will not only
write the Layer Names to an HTML file, but will also write the Layer properties and status. Let's have a
look at the coding.
(defun C:DUMPLAYERS
( / acad doc dwg layers name col ltp lwt pst onoff frz dat
path olist outfile output)
);setq
;on-off status
;frozen-thawed status
frz (if (= :vlax-true (vla-get-freeze each))
"FROZEN" "THAWED")
;list them
dat (list name col ltp lwt pst onoff frz)
);setq
); vlax-for
(princ)
Load and run this routine. The HTML file should automatically open in your browser.
Hey, is that not nice? All your layers, layer properties and status all nicely tabulated in a report! By the
way, if you are not very clued up on Visual Lisp, there are a whole set of Tutorials posted on AfraLisp
that you can use to familiarise yourself with this powerful addition to the AutoLisp language.
Okay, one more page to go. (phew.)
Now let's look at AutoCAD and HTML using Visual Basic. (Oooh, I can hear you say.)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
One area that Visual Basic stands out is in Batch Processing. In this example, we're going to design a
simple little standalone Visual Basic program that will "plot" a directory of drawings to DWF files. and
then create an HTML web page with a list of links to these DWF files.
By the way, this program can very easily be modified to suit any type of Batch Processing that your little
heart desires.
Firstly, you will need to insert a new Form with the following controls :
● DriveListBox - Drive1
● DirListBox - Dir1
● FileListBox - File1
● 5 Labels - Label1 to Label5
● CommandButton - btnExport
● CommandButton - btnCancel
Now enter the following coding under the General Declarations section :
(I recommend you download the source coding for this project as word-wrapping can cause major
problems. The download link is at the bottom of this page.)
Option Explicit
'----------------------
End
'End the Application
End Sub
'----------------------
'declare variables
Dim acadApp As Object
Dim acadDoc As Object
Dim filename As String
Dim dirname As String
Dim pViewport As Object
Dim mylen As Integer
Dim filename1 As String
Dim nFile As Integer
Dim MMode As Integer
Else
End If
End If
'open AutoCAD
Set acadApp = CreateObject("Autocad.Application")
'inform user
MsgBox Err.Description
'exit application
Exit Sub
End If
End If
'Check SDI
If MMode = 0 Then
'Switch it on
acadDoc.SetVariable "SDI", 1
End If
End If
End If
'*******************************************************************
'This is the section of the program where you process each drawing.
'You can do anything your little heart desires........
'zoom to extents
pViewport.ZoomExtents
End If
'carry on looping
Loop
'reset SDI
acadDoc.SetVariable "SDI", MMode
'Close Autocad
acadApp.Quit
End Sub
'-------------------------------
End Sub
'--------------------------------
End Sub
'---------------------------------
End Sub
Save your Project as "DwfBatcher." When you run this program, a dialog will appear as shown above.
Choose the drive and directory containing the drawings you would like to process, then select "Go for
it." If AutoCAD is not already open, it will be opened and each drawing will be plotted as a DWF file. On
completion, an HTML file will be created in the same directory as the drawings.
To download the source coding for all four of these routines, put the index finger of your left hand in
your right nostril, stick your tongue out, and then click here.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Publishing Coding
Okay, you've written your coding, it works great, your boss and your workmates think you're brilliant,
but now you would like to share your coding with the whole wide world.
So, off you go and organise yourself some web space, start your first page, put some witty comments
at the top, and then plonk in your coding.
Then this is what happens :
(defun c:al-move ( / util BP PT2) (vl-load-com) ;get a reference to the Utilities Object : (setq util (vla-get-utility
(vla-get-activedocument (vlax-get-acad-object)))) ;select the object (vla-getentity util 'theobj 'ip "\nSelect Object:
") ;get the base point (setq BP (vla-getpoint util nil "\nSpecify base point or displacement: ")) ;get the
displacement (setq PT2 (vla-getpoint util BP "\nSpecify second point of displacement: ")) ;move the object
(vla-move theobj BP PT2) (princ) );defun (princ)
All your beautifully formatted coding has become a jumbled mess because all the white space and line breaks have
been removed.
<pre>
</pre>
Your coding will now look like this :
(defun c:al-move ( / util BP PT2)
(vl-load-com)
(princ)
);defun
(princ)
An even better way, is to place your coding within the <pre> tags, AND within a table :
(vl-load-com)
(princ)
);defun
(princ)
Much easier to read and quite nice to look at if I may say so myself.
Here's the HTML coding for the table :
<table border="3" cellpadding="3" cellspacing="0" width="500" bgcolor="#00FFFF">
<tr>
<td>
<pre>
</pre>
</td>
</tr>
</table>
Now let's get really clever and place our coding into an Inline Frame :
[Netscape users should click here to see what they are missing]
Hey Kenny, now you're really cooking!!
<IFRAME
frameBorder=1 height=200 width=550 marginHeight=0 marginWidth=1 src="code.htm">[Netscape users should
click <a href="code.htm">here</a>
to see what they are missing]
</IFRAME>
But, the ultimate is to make use of Randall Rath's Language Formatter which will result in something like this :
[Netscape users should click here to see what they are missing]
The Language Formatter will convert your AutoLisp/VBA Coding into HTML, colour code it, and even add line
numbers if you so wish.
If you would like a standalone application that colour codes AutoLisp coding, have a look at "wLsp2html" written
by Mark Duenas.
Oh, just one more thing before I pop off to the fridge for another beer, would you like to strip all the white space out
of your AutoLisp coding?
<HTML>
<HEAD>
<TITLE>Strip White Space</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Now add you code between the <BODY> and </BODY> tags :
<HTML>
<HEAD>
<TITLE>Strip White Space</TITLE>
</HEAD>
<BODY>
(vl-load-com)
(princ)
);defun
(princ)
</BODY>
</HTML>
(defun c:al-move ( / util BP PT2) (vl-load-com) ;get a reference to the Utilities Object : (setq util (vla-get-utility
(vla-get-activedocument (vlax-get-acad-object)))) ;select the object (vla-getentity util 'theobj 'ip "\nSelect Object: ") ;get
the base point (setq BP (vla-getpoint util nil "\nSpecify base point or displacement: ")) ;get the displacement (setq PT2
(vla-getpoint util BP "\nSpecify second point of displacement: ")) ;move the object (vla-move theobj BP PT2) (princ)
);defun (princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(vl-load-com)
(princ)
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(vl-load-com)
(princ)
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Lisp to HTML
Download wLsp2html.zip (201 kB)
Here's a handy little program that will convert an AutoLisp file into HTML and create the web page. It
was written by a gentleman named Mark Duenas.
While you're here, pop along here and have a look at Mark's Guitar site :
http://www.cableone.net/mdeunas/guitar/default.htm
wLsphtml.exe is a windows version of Lsphtml.exe! (an upgrade of sorts) AutoLISP to HTML converter.
● To use this program double click on wlsphtml.exe to run the dialog
● Next click on the button next to the input file edit box to choose a single or multiple .LSP files to
convert to HTML.
● Next click on the button next to the output file edit box to choose an output directory.
● [optional] Next click on the button next to the Background Graphics File edit box to choose a
background image for the html file(s). This is optional so if you don’t have a background to
include you may ignore this field.
● [optional] The ‘Include Visual Lisp Functions’ check box includes the keywords for Visual Lisp
(over 1500 of them) in the conversion. So if you don’t use them and you have many files to
convert it would be faster not to check this check box.
● [optional] The ‘Exit after convert’ just exits the program after converting the file or files.
Questions, Comments, Bugs:
Please let me know how this program could better serve your needs. Thanks!
Mark Duenas
2698 N. Robie Ave.
Meridian, ID 83642
[email protected]
(exit)
;exit the application
);
(setq message (strcat "You have choosen " nfiles1 " files.
(if (= flag 6)
;if Yes selected
(progn
;do the following
(setq cntr 1)
;set the counter
;;;We'll now start the loop, format the file names, and add
;;;the commands to the script file.
(repeat (- nfiles 1)
;start the loop
);repeat
(close file1)
;close the script file
);progn
);if
(princ)
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Firstly, you need to build your Toolbar along with all relevant Bitmaps and test it within AutoCAD. Here is
the menu file for the VBA Toolbar which is in the downloadable sample file :
***MENUGROUP=VBA
***TOOLBARS
***HELPSTRINGS
Now, do yourself a favour and store the Menu file and all Bitmaps into their own sub-directory. If you don't,
you will find it a problem later on when editing the DLL file to locate all the VB support files.
Now fire up VB6 and start a new ActiveX DLL project. Next, open the VB6 Resource Editor. If it is not
loaded, go to the Add-In Manager and load it.
Once in the Resource Editor, load each of your Bitmap Files, renaming each Bitmap to match that of the
relevant name in the menu. (Right-Click on each name and select Properties.) Now save your project. (Save it
using the same name as your Menu and to the same sub-directory.)
Finally, choose "File" - "Make YourMenuName.DLL", again saving it to the same directory. (It is important
that the DLL file has the same name as the Menu.)
You can now exit VB6. (saving any files if prompted.)
One final step. (Well, a couple!!) Open up your Menu file and remove the .BMP extension from the Bitmap
file names. It should look like this :
***MENUGROUP=VBA
***TOOLBARS
***HELPSTRINGS
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
http://www.users.on.net/johnson/resourcehacker/
AutoCAD Usage :
Before you start, please unload the relevant menu file from AutoCAD and then delete the MNC,
MNS and MNR files belonging to the menu. You should be left with just your MNU file. This is to
prevent AutoCAD from getting confused.
First you must install "Resource Hacker."
Secondly have all your toolbar bitmap files ready and in one directory.
As far as I know, you cannot create a new DLL file using the "Resource Hacker," so I have
supplied an empty DLL file called "AfraLisp.dll." I would suggest you place this file in the same
directory as your bitmap files.
I have supplied some sample bitmaps and a sample AutoCAD Toolbar menu to use as an example.
O.K. away we go. Fire up the "Resource Hacker."
From the pulldown menu select "File" -> "Open" and select "AfraLisp.dll."
Next, select "Action" -> "Add a new Resource."
Click the "Open file with new resource" button, and select your first bitmap file.
In the "Resource Name" text box, enter the name of your bitmap, excluding the file extension:
Now, choose "File" -> "Save As" and save the file as "vbatoolbar.dll."
Now this is extremely important. The DLL file must have EXACTLY the same name as your menu
name and MUST be in the same directory. Copy the DLL file to the same directory as your MNU
file.
O.K. we've now created out Menu DLL file, but we still have to make some changes to our menu
file.
Open the menu file "vbatoolbar.mnu." It should look like this :
***MENUGROUP=VBA
***TOOLBARS
***HELPSTRINGS
You now need to remove the file extension from all of the bitmap references. Your menu file should
now look like this :
***MENUGROUP=VBA
***TOOLBARS
***HELPSTRINGS
You are now ready to try out your menu. Load and run it. Your toolbar should appear and look
like this :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
ResourceTool.exe
Ed Jobe © 2003
ResourceTool is a tool for use with VB to help with compiling resource dll's for a menu.
Normally, if you use the Resource Editor add-in and you load a
bmp, the editor assings a sequential number as the resource ID.
This means that if you want to continue referring to icons in your
menu by a name, you have to rename all the ID's in the RES file.
This tool avoids that using the rc.exe tool that comes with Visual
Studio. This utility can compile a C++ resource file (*.rc) into a
VB resource file (*.RES).
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Usage :
● There are three ways of selecting files to purge. You can use the "Select All" button to select all
the drawing files in the current directory, you can double click on individual files, or you can
select a file and use the "Add Files" button. All files selected will be added to the Purge File List
Box.
● You can select files from multiple directories.
● You can remove files from the Purge File List box by choosing "Remove All", double-clicking on a
file, or choosing a file and clicking the "Remove File" button.
● Once you are happy with the your file selection, select the "Purge" button to start the Batch Purge
Process. AutoCAD does not have to be open for the process to proceed.
● You can also selected the "Delete BAK Files" check box to have these files automatically deleted.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Usage :
● There are three ways of selecting files to purge. You can use the "Select All" button to select all
the drawing files in the current directory, you can double click on individual files, or you can
select a file and use the "Add Files" button. All files selected will be added to the Purge File List
Box.
● You can select files from multiple directories.
● You can remove files from the Purge File List box by choosing "Remove All", double-clicking on a
file, or choosing a file and clicking the "Remove File" button.
● Once you are happy with the your file selection, select the "Purge" button to start the Batch Purge
Process. AutoCAD does not have to be open for the process to proceed.
● You can also selected the "Delete BAK Files" check box to have these files automatically deleted.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
RC-Batcher (67Kb)
● Select "Run".
In the downloadable Zip file, I have included a sample lisp file (Slidem.lsp) that will create slides
from a selection of drawings.
This application is written in Visual Basic 6, so you may require MSVBVM60.DLL to run. Contact
Ramón or myself if you require it.
Ramón Castro is a Survey CADD Technician for City of Fort Lauderdale Engineering.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AcadExport.Exe is a stand alone application written in Visual Basic for AutoCAD Release 14.
This routine will Export a selected directory of drawings.
Formats available for export are WMF, DXF, EPS and BMP.
If AutoCAD is not open when you run the application, it will automatically open AutoCAD. You
can also run it from within Autocad.
Usage :
Open the application by double clicking on AcadExport.Exe.
A dialogue box will appear. Select the directory where the drawings you wish to Export reside.
Select the format you wish to export the file as from the radio buttons and then Select "OK".
If you wish to run it from within AutoCAD type the following at the command prompt :
(startapp "....directory path..../acadexport.exe")
Please note that you cannot Export Drawings to Drive A:.
The VBA Code
The following must be placed under the event procedure of the Drive List Box:
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
'retrieves the drive name
End Sub
Next, place this coding under the event procedure of the Directory List Box:
Private Sub Dir1_Change()
Else
dirname = File1.Path
'if root directory do nothing
End If
Me.Hide
'Hide the dialogue box
End
'end the application
End If
If Err Then
'if there is an error (AutoCAD not open)
Err.Clear
'clear the error
If Err Then
'if there is another error
MsgBox Err.Description
'inform user
Exit Sub
'exit application
End If
End If
acadApp.Visible = True
'Make Autocad Visible
Me.Hide
'Hide the dialogue box
End
'end if user selects No
Else
'or else
acadDoc.Save
'if Yes, save drawing
End If
mylen = Len(filename)
'get the length of the filename
mylen = mylen - 4
'subtract the .DWG Extension
pViewport.ZoomExtents
'zoom to extents
sset.Select acSelectionSetAll
'select the whole drawing
End If
End If
End If
End If
End If
If Option6.Value = True Then
'if radio button selected
End If
acadDoc.Save
'save the drawing
End If
End If
filename = Dir
'get the next entry
Loop
'carry on looping
acadApp.Quit
'Close Autocad
End
'Close VBA Application
End Sub
Finally, this coding goes under the event procedure of the "Cancel" button:
Private Sub btnCancel_Click()
End
'end the routine
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
BatchPurge.Exe is a stand alone application written in Visual Basic for AutoCAD Release 14.
This routine will Batch Purge (Purge All) a selected directory of drawings.
If AutoCAD is not open when you run the application, it will automatically open AutoCAD. You
can also run it from within Autocad.
Usage :
Open the application by double clicking on BatchPurge.Exe.
A dialogue box will appear. Select the directory where the drawings you wish to Purge reside. Select
"OK".
If you wish to run it from within AutoCAD type the following at the command prompt :
(startapp "....directory path..../batchpurge.exe")
The VBA Code
The following must be placed under the event procedure of the Drive List Box:
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
'retrieves the drive name
End Sub
Next, place this coding under the event procedure of the Directory List Box:
Private Sub Dir1_Change()
File1.Path = Dir1.Path
'retrieves the drive and directory name
End Sub
The main routine of the function is within the event procedure of the "Start Purge" button :
Private Sub Command1_Click()
Else
dirname = File1.Path
'if root directory do nothing
End If
Me.Hide
'Hide the dialogue box
End
'end the application
End If
If Err Then
'if there is an error (AutoCAD not open)
Err.Clear
'clear the error
If Err Then
MsgBox Err.Description
'inform user
Exit Sub
'exit application
End If
End If
acadApp.Visible = True
'Make Autocad Visible
Me.Hide
'Hide the dialogue box
End
'end if user selects No
Else
'or else
acadDoc.Save
'if Yes, save drawing
End If
End If
acadDoc.PurgeAll
'purge the drawing
acadDoc.Save
'save the drawing
End If
End If
filename = Dir
'get the next entry
Loop
'carry on looping
acadApp.Quit
'Close Autocad
End
'Close VBA Application
End Sub
Finally, this coding goes under the event procedure of the "Cancel" button :
Private Sub btnCancel_Click()
End
'end the routine
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Choose the directories you would like to back up from the Drive/Directory list boxes on the right,
clicking on "Add Folders >>" to add them to the "Folders Selected" list box. Highlight a directory
in the "Folders Selected" list box and select the "<< Clear Items" button to remove, or select "<<
Clear List" to remove all directories.
Next, select the "Browse" button to the right of the "Target" text box :
Select the target directory you would like your drawings to be backed up to and then select "OK."
You will return to the main screen.
Now select "Start Backup" to process your selection. The text box at the bottom will give you a
running status of progress.
When the backup is complete the Report Dialogue will appear listing the backup results :
Click on the "View Log File" to open the Backup Log File, or select "Continue" to process
additional backups.
Select the "Backup All Files" check box on the main screen if you want to backup all files
including drawing files.
You can also view the Log File from recent Backups by selecting the "View Log File" from the
main screen.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Introduction
Napoleon
In the interests of creating employment opportunities in the Java programming field, I am passing on
these tips from the masters on how to write code that is so difficult to maintain, that the people who
come after you will take years to make even the simplest changes. Further, if you follow all these rules
religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope
in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn't
be able to maintain the code!
You don't want to overdo this. Your code should not look hopelessly unmaintainable, just be that way.
Otherwise it stands the risk of being rewritten or refactored.
General Principles
He views your code through a tube taken from the centre of a roll of toilet paper. He can only see a tiny
piece of your program at a time. You want to make sure he can never get at the big picture from doing
that. You want to make it as hard as possible for him to find the code he is looking for. But even more
important, you want to make it as awkward as possible for him to safely ignore anything.
Programmers are lulled into complacency by conventions. By every once in a while subtly violating
convention you force him to read every line of your code with a magnifying glass.
You might get the idea that every language feature makes code unmaintainable -- not so, only if properly
misused.
Naming
"When I use a word," Humpty Dumpty said, in a rather scornful tone, "it means just what I
choose it to mean - neither more nor less."
Much of the skill in writing unmaintainable code is the art of naming variables and methods. They don't
matter at all to the computer. That gives you huge latitude to use them to befuddle the maintenance
programmer.
Buy a copy of a baby naming book and you'll never be at a loss for variable names. Fred is a
wonderful name, and easy to type. If you're looking for easy to type variable names, try adsf.
3. Creative Missspelling
If you must use descriptive variable and function names, misspell them. By misspelling in some
function and variable names, and spelling it correctly in others (such as SetPintleOpening
SetPintalClosing) we effectively negate the use of grep or CodeWright search techniques. It works
amazingly well. Add an international flavor by spelling theater and theatre in different situations.
4. Be Abstract
In naming functions and variables, make heavy use of abstract words like it, everything, data,
handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt,
HandleStuff and do_args_method.
5. A.C.R.O.N.Y.M.S.
Use acronyms to keep the code terse. Real men never define acronyms; they understand them
genetically.
6. Thesaurus Surrogatisation
To break the boredom, use a thesaurus to look up as much alternate vocabulary as possible to
refer to the same action, e.g. display, show, present. Vaguely hint there is some subtle difference,
where none exists. However, if there are two similar functions that have a crucial difference,
always use the same word in describing both functions (e.g. print to mean write to a file, and to a
print on a laser, and to display on the screen). Under no circumstances, succumb to demands to
write a glossary with the special purpose project vocabulary unambiguously defined. Doing so
would be unprofessional breach of the structured design principle of information hiding.
8. CapiTaliSaTion
If you use intercapitalization for function names (capitalize the first letter of each word), randomly
capitalize the first letter of a syllable in the middle of a word. For example:
ComputeRasterHistoGram().
where the second int's i is actually iacute. Since these are structures the three int's are not
interchangeable, but with an 8-bit aware editor it's nearly impossible to distinguish the slant of
the accent mark. Insist the new "ints " are for some specific, but very obscure, situation where a
standard int won't suffice. It helps to toss extra stuff into the structure before making that claim!
If you cannot find the right English word to convey the meaning of a temporary variable (and you
ignore the other suggestions about not giving meaningful names to variables), you may use a
foreign language word as the name of the variable. For example, instead of using variable "p" for
a "point", you may use "punkt", which is the German word for it. Maintenance coders without
your firm grasp of German will enjoy the multicultural experience of deciphering the meaning. It
breaks the tedium of an otherwise tiring and thankless job.
Choose variable names that are English versions of operators, to get statements like:
This confuses the reader because they have difficulty disassociating the concepts of the words
from the logic they're trying to think about. (Combine this with the above method and it's basically
impossible to recover, because search and replace becomes impossible.)
Use scoping as confusingly as possible by recycling variable names in contradictory ways. For
example, suppose you have global variables A and B, and functions foo and bar. If you know that
variable A will be regularly passed to foo and B to bar, make sure to define the functions as
function foo(B) and function bar(A) so that inside the functions A will always be referred to as B
and vice versa. With more functions and globals, you can create vast confusing webs of mutually
contradictory uses of the same names.
Wherever scope rules permit, reuse existing unrelated variable names. Similarly, use the same
temporary variable for two unrelated purposes (purporting to save stack slots). For a fiendish
variant, morph the variable, for example, assign a value to a variable at the top of a very long
method, and then somewhere in the middle, change the meaning of the variable in a subtle way,
such as converting it from a 0-based coordinate to a 1-based coordinate. Be certain not to
document this change in meaning.
28. m_
a naming convention from the world of C++ is the use of "m_" in front of members. This is
supposed to help you tell them apart from methods, so long as you forget that "method" also
starts with the letter "m".
Insist on using "c" for const in C++ and other languages that directly enforce the
const-ness of a variable.
Seek out and use Hungarian warts that have meaning in languages other than your current
language. For example insist on the PowerBuilder "l_" and "a_ " {local and argument}
scoping prefixes and always use the VB-esque style of having a Hungarian wart for every
control type when coding to C++. Try to stay ignorant of the fact that megs of plainly visible
MFC source code does not use Hungarian warts for control types.
Always violate the Hungarian principle that the most commonly used variables should
carry the least extra information around with them. Achieve this end through the
techniques outlined above and by insisting that each class type have a custom wart prefix.
Never allow anyone to remind you that no wart tells you that something is a class. The
importance of this rule cannot be overstated: if you fail to adhere to its principles the
source code may become flooded with shorter variable names that have a higher
vowel/consonant ratio. In the worst case scenario this can lead to a full collapse of
obfuscation and the spontaneous reappearance of English Notation in code!
Flagrantly violate the Hungarian-esque concept that function parameters and other high
visibility symbols must be given meaningful names, but that Hungarian type warts all by
themselves make excellent temporary variable names.
Insist on carrying outright orthogonal information in your Hungarian warts. Consider this
real world example: "a_crszkvc30LastNameCol". It took a team of maintenance engineers
nearly 3 days to figure out that this whopper variable name described a const, reference,
function argument that was holding information from a database column of type
Varchar[30] named "LastName" which was part of the table's primary key. When properly
combined with the principle that "all variables should be public" this technique has the
power to render thousands of lines of source code obsolete instantly!
Use to your advantage the principle that the human brain can only hold 7 pieces of
information concurrently. For example code written to the above standard has the following
properties:
A single function call that passes three parameters and assigns a result carries 29 pieces
of type and name information.
Seek to improve this excellent, but far too concise, standard. Impress management and
coworkers by recommending a 5 letter day of the week prefix to help isolate code written
on 'Monam' and 'FriPM'.
It is easy to overwhelm the short term memory with even a moderately complex nesting
structure, especially when the maintenance programmer can't see the start and end of each
block on screen simultaneously.
Camouflage
Roedy
Much of the skill in writing unmaintainable code is the art of camouflage, hiding things, or making
things appear to be what they are not. Many depend on the fact the compiler is more capable at making
fine distinctions than either the human eye or the text editor. Here are some of the best camouflaging
techniques.
Include sections of code that is commented out but at first glance does not appear to be.
{
total += array[j+0 ];
total += array[j+1 ];
total += array[j+2 ]; /* Main body of
total += array[j+3]; * loop is unrolled
total += array[j+4]; * for greater speed.
total += array[j+5]; */
total += array[j+6 ];
total += array[j+7 ];
}
Without the colour coding would you notice that three lines of code are commented out?
2. Arbitrary Names That Masquerade as Keywords
When documenting, and you need an arbitrary name to represent a filename use "file ". Never use
an obviously arbitrary name like "Charlie.dat" or "Frodo.txt". In general, in your examples, use
arbitrary names that sound as much like reserved keywords as possible. For example, good
names for parameters or variables would be: "bank", "blank", "class", "const ", "constant",
"input", "key", "keyword", "kind", "output", "parameter" "parm", "system", "type", "value", "var"
Variables that resemble others except for capitalization and underlines have the advantage of
confounding those who like remembering names by sound or letter-spelling, rather than by exact
representations.
Documentation
Any fool can tell the truth, but it requires a man of some sense to know how to lie well.
Bertrand Meyer
Since the computer ignores comments and documentation, you can lie outrageously and do everything
in your power to befuddle the poor maintenance programmer.
1. Lie in the comments
You don't have to actively lie, just fail to keep comments as up to date with the code.
In fact, the design doc should break the algorithm down into a hierarchy of structured steps,
described in a hierarchy of auto-numbered individual paragraphs in the document. Use headings
at least 5 deep. Make sure that when you are done, you have broken the structure down so
completely that there are over 500 such auto-numbered paragraphs. For example, one paragraph
might be: (this is a real example)
1.2.4.6.3.13 - Display all impacts for activity where selected mitigations can apply (short
pseudocode omitted).
then... (and this is the kicker) when you write the code, for each of these paragraphs you write a
corresponding global function named:
Act1_2_4_6_3_13()
Do not document these functions. After all, that's what the design document is for!
Since the design doc is auto-numbered, it will be extremely difficult to keep it up to date with
changes in the code (because the function names, of course, are static, not auto-numbered.) This
isn't a problem for you because you will not try to keep the document up to date. In fact, do
everything you can to destroy all traces of the document.
Those who come after you should only be able to find one or two contradictory, early drafts of the
design document hidden on some dusty shelving in the back room near the dead 286 computers.
6. Gotchas
Never document gotchas in the code. If you suspect there may be a bug in a class, keep it to
yourself. If you have ideas about how the code should be reorganised or rewritten, for heaven's
sake, do not write them down. Remember the words of Thumper in the movie Bambi "If you can't
say anything nice, don't say anything at all". What if the programmer who wrote that code saw
your comments? What if the owner of the company saw them? What if a customer did? You could
get yourself fired. An anonymous comment that says "This needs to be fixed!" can do wonders,
especially if it's not clear what the comment refers to. Keep it vague, and nobody will feel
personally criticized.
7. Documenting Variables
Neverput a comment on a variable. Facts about how the variable is used, its bounds, its legal
values, its implied/displayed number of decimal points, its units of measure, its display format, its
data entry rules (e.g. total fill, must enter), when its value can be trusted etc. should be gleaned
from the procedural code. If your boss forces you to write comments, lard method bodies with
them, but never comment a variable, not even a temporary!
This stuff is too clever for the dullard at Software Services Inc., who would
probably use 50 times as memory & time using the dumb routines in .
.. .
}
If possible, put insulting stuff in syntactically significant parts of the code, as well as just the
comments so that management will probably break the code if they try to sanitize it before
sending it out for maintenance.
Program Design
The cardinal rule of writing unmaintainable code is to specify each fact in as many places
as possible and in as many ways as possible.
Roedy
1. The key to writing maintainable code is to specify each fact about the application in only one
place. To change your mind, you need change it in only one place, and you are guaranteed the
entire program will still work. Therefore, the key to writing unmaintainable code is to specify a
fact over and over, in as many places as possible, in as many variant ways as possible. Happily,
languages like Java go out of their way to make writing this sort of unmaintainable code easy. For
example, it is almost impossible to change the type of a widely used variable because all the
casts and conversion functions will no longer work, and the types of the associated temporary
variables will no longer be appropriate. Further, if the variable is displayed on the screen, all the
associated display and data entry code has to be tracked down and manually modified. The Algol
family of languages which include C and Java treat storing data in an array, Hashtable, flat file
and database with totally different syntax. In languages like Abundance, and to some extent
Smalltalk, the syntax is identical; just the declaration changes. Take advantage of Java's
ineptitude. Put data you know will grow too large for RAM, for now into an array. That way the
maintenance programmer will have a horrendous task converting from array to file access later.
Similarly place tiny files in databases so the maintenance programmer can have the fun of
converting them to array access when it comes time to performance tune.
2. Never Validate
Never check input data for any kind of correctness or discrepancies. It will demonstrate that you
absolutely trust the company's equipment as well as that you are a perfect team player who trusts
all project partners and system operators. Always return reasonable values even when data
inputs are questionable or erroneous.
4. Avoid Encapsulation
In the interests of efficiency, avoid encapsulation. Callers of a method need all the external clues
they can get to remind them how the method works inside.
7. Dummy Interfaces
Write an empty interface called something like "WrittenByMe", and make all of your classes
implement it. Then, write wrapper classes for any of Java's built-in classes that you use. The idea
is to make sure that every single object in your program implements this interface. Finally, write
all methods so that both their arguments and return types are WrittenByMe. This makes it nearly
impossible to figure out what some methods do, and introduces all sorts of entertaining casting
requirements. For a further extension, have each team member have his/her own personal
interface (e.g., WrittenByJoe); any class worked on by a programmer gets to implement his/her
interface. You can then arbitrary refer to objects by any one of a large number of meaningless
interfaces!
11. No Secrets!
Declare every method and variable public. After all, somebody, sometime might want to use it.
16. Packratting
Keep all of your unused and outdated methods and variables around in your code. After all - if
you needed to use it once in 1976, who knows if you will want to use it again sometime? Sure the
program's changed since then, but it might just as easily change back, you "don't want to have to
reinvent the wheel" (supervisors love talk like that). If you have left the comments on those
methods and variables untouched, and sufficiently cryptic, anyone maintaining the code will be
too scared to touch them.
Testing
Om I. Baud
Leaving bugs in your programs gives the maintenance programmer who comes along later something
interesting to do. A well done bug should leave absolutely no clue as to when it was introduced or
where. The laziest way to accomplish this is simply never to test your code.
1. Never Test
Never test any code that handles the error cases, machine crashes, or OS glitches. Never check
return codes from the OS. That code never gets executed anyway and slows down your test
times. Besides, how can you possibly test your code to handle disk errors, file read errors, OS
crashes, and all those sorts of events? Why, you would have to either an incredibly unreliable
computer or a test scaffold that mimicked such a thing. Modern hardware never fails, and who
wants to write code just for testing purposes? It isn't any fun. If users complain, just blame the
OS or hardware. They'll never know.
If we have full confidence in our coding ability, then testing will be unnecessary. If we look at this
logically, then any fool can recognize that testing does not even attempt to solve a technical
problem, rather, this is a problem of emotional confidence. A more efficient solution to this lack of
confidence issue is to eliminate testing completely and send our programmers to self-esteem
courses. After all, if we choose to do testing, then we have to test every program change, but we
only need to send the programmers to one course on building self-esteem. The cost benefit is as
amazing as it is obvious.
#define TESTING 1
this gives you the wonderful opportunity to have separate code sections, such as
#if TESTING==1
#endif
x = rt_val;
so that if anyone resets TESTING to 0, the program won't work. And with the tiniest bit of
imaginative work, it will not only befuddle the logic, but confound the compiler as well.
Choice Of Language
Computer languages are gradually evolving to become more fool proof. Using state of the art languages
is unmanly. Insist on using the oldest language you can get away with, octal machine language if you
can (Like Hans und Frans, I am no girlie man; I am so virile I used to code by plugging gold tipped wires
into a plugboard of IBM unit record equipment (punch cards), or by poking holes in paper tape with a
hand punch), failing that assembler, failing that FORTRAN or COBOL, failing that C, and BASIC, failing
that C++.
1. FØRTRAN
Write all your code in FORTRAN. If your boss ask why, you can reply that there are lots of very
useful libraries that you can use thus saving time. However the chances of writing maintainable
code in FORTRAN are zero, and therefore following the unmaintainable coding guidelines is a lot
easier.
2. Avoid Ada
About 20% of these techniques can't be used in Ada. Refuse to use Ada. If your manager presses
you, insist that no-one else uses it, and point out that it doesn't work with your large suite of tools
like lint and plummer that work around C's failings.
3. Use ASM
4. Use QBASIC
Leave all important library functions written in QBASIC, then just write an asm wrapper to handle
the large->medium memory model mapping.
5. Inline Assembler
Sprinkle your code with bits of inline assembler just for fun. Almost no one understands
assembler anymore. Even a few lines of it can stop a maintenance programmer cold.
6. MASM call C
If you have assembler modules which are called from C, try to call C back from the assembler as
often as possible, even if it's only for a trivial purpose and make sure you make full use of the
goto, bcc and other charming obfuscations of assembler.
There are many hints sprinkled thoroughout the tips above on how to rattle maintenance programmers
though frustration, and how to foil your boss's attempts to stop you from writing unmaintainable code,
or even how to foment an RWAR that involves everyone on the topic of how code should be formatted
in the repository.
1. Your Boss Knows Best
If your boss thinks that his or her 20 year old FORTRAN experience is an excellent guide to
contemporary programming, rigidly follow all his or her recommendations. As a result, the boss
will trust you. That may help you in your career. You will learn many new methods to obfuscate
program code.
Alias table names to one or two letters. Better still alias them to the names of other unrelated
existing tables.
Mix the various flavours of outer join syntax just to keep everyone on their toes.
● JavaScript Scope
"Optimise" JavaScript code taking advantage of the fact a function can access all local variables
in the scope of the caller.
Instead of:
If reading from a text file, read 15 characters more than you need to then embed the actual text
string like so:
ReadChar = trim(left(mid(ReadChar,len(ReadChar)-15,len(ReadChar)-5),7))
If ReadChars = "alongsentancewithoutanyspaces"
Mid,14,24 = "withoutanys"
and left,5 = "without"
If you give someone a program, you will frustrate them for a day; if you teach them
how to program, you will frustrate them for a lifetime.
Anonymous
1. Don't Recompile
Let's start off with probably the most fiendish technique ever devised: Compile the code to
an executable. If it works, then just make one or two small little changes in the source
code...in each module. But don't bother recompiling these. You can do that later when you
have more time, and when there's time for debugging. When the hapless maintenance
programmer years later makes a change and the code no longer works, she will
erroneously assume it must be something she recently changed. You will send her off on a
wild goose chase that will keep her busy for weeks.
CANI
Constant And Never-ending Improvement. Make "improvements" to your code often, and
force users to upgrade often - after all, no one wants to be running an outdated version.
Just because they think they're happy with the program as it is, just think how much
happier they will be after you've "fixed" it! Don't tell anyone what the differences between
versions are unless you are forced to - after all, why tell someone about bugs in the old
version they might never have noticed otherwise?
2. About Box
The About Box should contain only the name of the program, the names of the coders and
a copyright notice written in legalese. Ideally it should link to several megs of code that
produce an entertaining animated display. However, it should never contain a description
of what the program is for, its minor version number, or the date of the most recent code
revision, or the website where to get the updates, or the author's email address. This way
all the users will soon all be running on different versions, and will attempt to install
version N+2 before installing version N+1.
3. Ch ch ch Changes
The more changes you can make between versions the better, you don't want users to
become bored with the same old API or user interface year after year. Finally, if you can
make this change without the users noticing, this is better still - it will keep them on their
toes, and keep them from becoming complacent.
4. No Skill Required
You don't need great skill to write unmaintainable code. Just leap in and start coding. Keep
in mind that management still measures productivity in lines of code even if you have to
delete most of it later.
6. Standards Schmandards
Whenever possible ignore the coding standards currently in use by thousands of
developers in your project's target language and environment. For example insist on STL
style coding standards when writing an MFC based application.
8. Avoid Libraries
Feign ignorance of libraries that are directly included with your development tool. If coding
in Visual C++ ignore the presence of MFC or the STL and code all character strings and
arrays by hand; this helps keep your pointer skills sharp and it automatically foils any
attempts to extend the code.
Philosophy
An example of the result of this sort of elitist thinking is the JDBC interface. It makes life easy for
the JDBC implementor, but a nightmare for the maintenance programmer. It is far clumsier than
the FORTRAN interface that came out with SQL three decades ago.
Maintenance programmers, if somebody ever consulted them, would demand ways to hide the
housekeeping details so they could see the forest for the trees. They would demand all sorts of
shortcuts so they would not have to type so much and so they could see more of the program at
once on the screen. They would complain loudly about the myriad petty time-wasting tasks the
compilers demand of them.
There are some efforts in this direction: NetRexx, Bali, and visual editors (e.g. IBM's Visual Age is
a start) that can collapse detail irrelevant to the current purpose.
Imagine having an accountant as a client who insisted on maintaining his general ledgers using a
word processor. You would do you best to persuade him that his data should be structured. He
needs validation with cross field checks. You would persuade him he could do so much more
with that data when stored in a database, including controlled simultaneous update.
Imagine taking on a software developer as a client. He insists on maintaining all his data with a
text editor. He is not yet even exploiting the word processor's colour, type size or fonts.
Think of what might happen if we started storing source code as structured data. We could view
the same source code in many alternate ways, e.g. as Java, as NextRex, as a decision table, as a
flow chart, as a loop structure skeleton (with the detail stripped off), as Java with various levels of
detail or comments removed, as Java with highlights on the variables and method invocations of
current interest, or as Java with generated comments about argument names and/or types. We
could display complex arithmetic expressions in 2D, the way TeX and mathematicians do. You
could see code with additional or fewer parentheses, (depending on how comfortable you feel
with the precedence rules ). Parenthesis nests could use varying size and colour to help matching
by eye. With changes as transparent overlay sets that you can optionally remove or apply, you
could watch in real time as other programmers on your team, working in a different country,
modified code in classes that you were working on too.
You could use the full colour abilities of the modern screen to give subliminal clues, e.g. by
automatically assigning a portion of the spectrum to each package/class using a pastel shades as
the backgrounds to any references to methods or variables of that class. You could bold face the
definition of any identifier to make it stand out.
You could ask what methods/constructors will produce an object of type X? What methods will
accept an object of type X as a parameter? What variables are accessible in this point in the
code? By clicking on a method invocation or variable reference, you could see its definition,
helping sort out which version of a given method will actually be invoked. You could ask to
globally visit all references to a given method or variable, and tick them off once each was dealt
with. You could do quite a bit of code writing by point and click.
Some of these ideas would not pan out. But the best way to find out which would be valuable in
practice is to try them. Once we had the basic tool, we could experiment with hundreds of similar
ideas to make life easier for the maintenance programmer.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Shadow Control
Would you like to place shadows on your controls?
Would you like to give your forms a 3D appearance?
The here we go......
End Sub
End Sub
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
You've written your AutoLisp and VBA routines, you've set up your Block Libraries and your Custom
Partial Menu is now complete. Everything has been tested but now you hit another snag. You'd like to
distribute your custom application to other drawing officers, or maybe you have 50 machines in your
office that you would like to install it on but you have one big problem. Having to set up each individual
machine is a real pain. There are directories to be created, support paths to be added, menu's to be
loaded, etc, etc. And if you are distributing it outside the office, you now have to try and put your setup
into words that can be clearly understood by the poor guy on the other end.
In this tutorial we are going to have a look at automating the whole process. We are going to make use
of two remarkable software applications that will make this a breeze, namely "Inno Setup" and "Acad
Install".
"Inno Setup" will be used to install our required support files, and "Acad Install" will do the job of
configuring AutoCAD for us, all with a lovely user interface.
Firstly though, we have a bit of forward planning to do before we start compiling our Custom
Application Setup.
Step 1
All your programs, menu's, etc. must be fully tested and free of errors. Test them on as many operating
systems and AutoCAD versions as possible to ensure they are bug free.
Step 2
Create a dedicated folder, with sub-folders for your application. The example we will be using here looks
like this :
This is a very simple directory structure with only three sub-folders. You can though, create as many as
you wish to suit your needs. Oh, before I forget, all your files need to be placed within these folders
AND, now this is important, if you want to install a partial menu, this MUST reside in the root folder. eg.
afralisp2004_install.
Step 3
Now we need to download some software. Pop along to both of these sites and download the latest
version of "Inno Setup" and "Acad Install".
Inno Setup
Acad Install
CADWERX - http://www.cadwerx.net/
In fact, now is maybe a good time to have a wee read of the "Inno Setup" and the "Acad Install" help
files to familiarise yourself with the software and give yourself a basic understanding of what we are
doing.
Step 4
As you have probably noticed when installing other software, during installation certain pages such as
a License notice or a ReadMe notice appear. Well now we need to create 3 files to go along with our
installation application - A License Notice, a Warning Notice and a Config Notice. You can use plain old
Notepad for this task, saving them as straight forward TXT files. This is what our example files look like.
License Notice :
=========================
AfraLisp
[email protected]
http://www.afralisp.com
=========================
Warning Notice :
WARNING!
==========
2) Added the AfraLisp AutoCAD 2004 Custom Menu to your menu bar,
and installed any applicable Toolbars.
Okay, that seems to be everything ready. Let's just have a quick look at what our root folder looks like
and the files therein :
Okay, now let's create our Setup Script. See you on the next page........
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Welcome back everyone. So are you ready to create your Setup Script?
You are!! Okay fire up "Inno Setup". This dialog should appear :
For the sake of simplicity, and 'cos it's less work, select the "Create a new script file using the Script
Wizard" option button and then select "OK".
The Wizard will then appear. Say hello, ask how Harry Potter is and then select "Next".
Fill in each edit box replacing the contents with your own details if you so wish.
Select "Next".
We would like our Application to be installed in the Program Files directory and we are happy with the
Application Directory name. You can uncheck the "Allow user to change the application directory" if
you wish. Click on "Next" again.
Okay, this is the important part. Firstly you need to select AcadInst.exe as the "Application main
executable file". This is the file that will run after the installation is complete. You then need to select
ALL files AND directories that you want to include within the installation. DO NOT forget the AcadInst.ini
file.
Once finished with your selections, press "Next".
Now we need to set up our icons. We would like to "Create an Internet shortcut in the Start Menu
folder", and we would like to "Create an Uninstall icon in the Start Menu folder". We DO NOT want to
"Allow user to create a desktop icon". "Acad Install" will take care of that for us. Select "Next" yet again.
This is where we include our License, Warning and Config text files.
Yep, you've guessed, press "Next" again.
Right, that's us about done. Now just for a change, select the "Finish" button.
No, we do not want to compile our script as of yet as we have a few tweeks to take care of. Select "No".
Looks nice hey. Have a look at these lines under the [Files] section :
As we do not want "Acad Install" to run at this time, you now need to comment out the following
section. You comment it out by placing a semi-colon ( ; ) at the beginning of the line.
;[Run]
;Filename: "{app}\AcadInst.exe"; Description: "Launch AfraLisp 2004 Custom Menu"; Flags: nowait postinstall
skipifsilent
Your script will look something like this. (I've added the comments by the way).
Now save your script as "AfraLisp.iss" into the root folder of your application.
Okey Doke, it's now time to test our script. Let's do that on the next page.
Exciting hey??
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
[Setup]
AppName=AfraLisp 2004 Custom Menu
;the name of the application
AppVerName=AfraLisp 2004 Custom Menu Version 1.5
;the version of the application
AppPublisher=AfraLisp
;the publisher
AppPublisherURL=http://www.afralisp.com
;the publishes web address
AppSupportURL=http://www.afralisp.com
;the publishes support address
AppUpdatesURL=http://www.afralisp.com
;the publishes update address
DefaultDirName={pf}\AfraLisp 2004 Custom Menu
;the default installation folder
;(pf) denotes "Program Files"
DefaultGroupName=AfraLisp 2004 Custom Menu
;the group name
DisableProgramGroupPage=yes
;we do not want a group page
LicenseFile=C:\afralisp2004_Install\license.txt
;path to the License file
InfoBeforeFile=C:\afralisp2004_Install\warning.txt
;path to the Warning file
InfoAfterFile=C:\afralisp2004_Install\config.txt
;path to the Config file
[Files]
;Path to source files/folders and Destination folders.
;(app) denotes The application directory, which the user
[INI]
Filename: "{app}\AcadInst.url"; Section: "InternetShortcut"; Key: "URL"; String: "http:/
[Icons]
;shortcut icons
Name: "{group}\AfraLisp 2004 Custom Menu"; Filename: "{app}\AcadInst.exe"
Name: "{group}\AfraLisp 2004 Custom Menu on the Web"; Filename: "{app}\AcadInst.url"
Name: "{group}\Uninstall AfraLisp 2004 Custom Menu"; Filename: "{uninstallexe}"
;[Run]
; NOTE: The following entry contains an English phrase ("Launch"). You are free to trans
language if required.
;Filename: "{app}\AcadInst.exe"; Description: "Launch AfraLisp 2004 Custom Menu"; Flags:
skipifsilent
[UninstallDelete]
;delete these files on uninstall
Type: files; Name: "{app}\AcadInst.url"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
To test our set up script, we first need to compile the script. Re-open "AfraLisp.iss" and choose "File" "Compile"
from the pull down menu. Bells will ring and buzzes will buzz and at the end of it your script will be compiled. Have
a look at your application folder structure now :
You should have a new sub-folder entitled "Output". Within this folder you will find a file named "Setup.exe".
Double click on it. This should appear :
Ha, ha!! Our License!! Select "I accept the agreement" and then "Next".
Just default through this unless you really want to change the Destination Directory.
Select "Next" again. Phew!!
A progress bar will appear as your files are installed. Once complete, this will appear :
Just some instructions to let the user know what has happened in regards to the AutoCAD configuration. Nothing
has happened though, because we disabled the "Acad Install" section of the script. Click on the "Next" button.
Let's pop along to "Program Files" and see what we can find.
Hey, all our Folders, sub-folders and files have been installed.
This is magic!!!
Now look under "Start" "Programs" for "AfraLisp 2004 Custom Menu".
Before we go any further, we need to tweek our setup script just a wee bit more to integrate with "Acad Install".
Under the [Run] section of AfraLisp.iss you will find this line :
;[Run]
;the program to run
;Filename: "{app}\AcadInst.exe"; Description: "Launch AfraLisp 2004 Custom Menu"; Flags: nowait postinstall
skipifsilent
Remove the semi-colons from the beginning of the lines and make these changes :
Filename: "{app}\AcadInst.exe"; Description: "Configure AutoCAD"; Parameters: {app}; Flags: waituntilidle
Now add this to the bottom of the script :
[UninstallRun]
;run this program on uninstall
Filename: "{app}\AcadInst.exe"; Parameters: -U
We now need to configure "Acad Install" to integrate with our setup application.
This we will do on the next page.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
[Setup]
AppName=AfraLisp 2004 Custom Menu
;the name of the application
AppVerName=AfraLisp 2004 Custom Menu Version 1.5
;the version of the application
AppPublisher=AfraLisp
;the publisher
AppPublisherURL=http://www.afralisp.com
;the publishes web address
AppSupportURL=http://www.afralisp.com
;the publishes support address
AppUpdatesURL=http://www.afralisp.com
;the publishes update address
DefaultDirName={pf}\AfraLisp 2004 Custom Menu
;the default installation folder
;(pf) denotes "Program Files"
DefaultGroupName=AfraLisp 2004 Custom Menu
;the group name
DisableProgramGroupPage=yes
;we do not want a group page
LicenseFile=C:\afralisp2004_Install\license.txt
;path to the License file
InfoBeforeFile=C:\afralisp2004_Install\warning.txt
;path to the Warning file
InfoAfterFile=C:\afralisp2004_Install\config.txt
;path to the Config file
[Files]
;Path to source files/folders and Destination folders.
;(app) denotes The application directory, which the user
[INI]
Filename: "{app}\AcadInst.url"; Section: "InternetShortcut"; Key: "URL"; String: "http:/
[Icons]
;shortcut icons
Name: "{group}\AfraLisp 2004 Custom Menu"; Filename: "{app}\AcadInst.exe"
Name: "{group}\AfraLisp 2004 Custom Menu on the Web"; Filename: "{app}\AcadInst.url"
Name: "{group}\Uninstall AfraLisp 2004 Custom Menu"; Filename: "{uninstallexe}"
[Run]
the program to run after install
Filename: "{app}\AcadInst.exe"; Description: "Configure AutoCAD"; Parameters: {app}; Fla
[UninstallDelete]
;delete these files on uninstall
Type: files; Name: "{app}\AcadInst.url"
[UninstallRun]
;run this program on uninstall
Filename: "{app}\AcadInst.exe"; Parameters: -U
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
[PRODUCT]
Name=MyAcadApp
RegPath=MyCompany\MyAcadApp\MyAppVersion
License=
Silent=
[AUTOCAD]
Versions=R15.0,R16.0
Products=
SerialNumbers=
AddPath=|1
Silent=
[AUTOCAD LT]
Versions=R2000
Products=
SerialNumbers=
AddPath=
Silent=
[ARX]
Install=CdWxMyAppArx
Uninstall=
Description=My app's arx description
LoadCtrls=13
Loader=MyAppArx
Groups=GROUP1:GROUP1
Commands=COMMAND1:COMMAND1,COMMAND2:COMMAND2
[ARX2]
[MENU]
MenuGroups=MyMainMenu:MyMenuFile:1:3,MyOtherMenu:MyMenuFile
Toolbars=MyMainMenu.TB_MAIN
[APPLOAD]
StartupSuite=\MyAppVlx.vlx
History=\MyAppVlx.vlx
[ACADDOC]
[STARTAPP]
[NEWPROFILE]
Name=MyProfile
Description=My profile for my AutoCAD application.
CopyFrom=
MakeDefault=T
DesktopShortcut=T
QuickLaunchButton=T
[General]
;Blipmode=1
;TemplatePath=\Templates
First, let's strip out what we won't need or will not be using. Your AcadInst.ini file should now look like
this :
[PRODUCT]
Name=MyAcadApp
RegPath=MyCompany\MyAcadApp\MyAppVersion
[AUTOCAD]
Versions=R15.0,R16.0
AddPath=|1
[MENU]
MenuGroups=MyMainMenu:MyMenuFile:1:3,MyOtherMenu:MyMenuFile
Toolbars=MyMainMenu.TB_MAIN
[NEWPROFILE]
Name=MyProfile
[General]
TemplatePath=\Templates
Now make these changes as shown in red. I've added comments to each change to explain what is going
on :
[PRODUCT]
[AUTOCAD]
Versions=R15.0,R16.0
;the AutoCAD version/s to be configured
AddPath=<InstallPath>|1;<InstallPath>\Lib2004|2;<InstallPath>\Lisp2004|3
;the support paths to be added and their positions
[MENU]
MenuGroups=AFRALISP:AFRALISP:1:50
;the pull down menu to be added
Toolbars=AFRALISP.LAYMAN
;the toolbar to be added
[NEWPROFILE]
Name=AfraLisp
;the name of the profile to be added
Description=AfraLisp 2004 Menu Profile.
;the description of the profile
CopyFrom=<CURRENT>
;copy the profile from the current profile
MakeDefault=T
;make it the default profile;make it the default profile
DesktopShortcut=T
;yes we want a desktop shortcut
ShortcutName=AfraLisp Profile
;name of the shortcut
ShortcutComment=AfraLisp Custom Menu Profile
;the tooltip
ShortcutArgs=/p "AfraLisp"
;the arguments on startup
ShortcutWorkingDir=C:\drawings
;the working directory
[<PROFILE>General]
TemplatePath=<STRING><InstallPath>\Templates
;the template file path
Let's have a look at our setup application in action. See you on the next page.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
To try out our full installation, we first need to re-compile our "setup.exe".
Re-open your "Acadlisp.iss" file and again choose "Files" - "Compile".
Again, open the "Output" folder and double click "setup.exe".
The installation will proceed as before until you reach this point and this dialog appears :
Select the profile that you would like to install your custom installation to, and then select "Okay" The
Config page and the "Finish" page will then appear.
That's it, your custom installation is complete. Let's check. First have a look on your desktop. You
should have a new shortcut icon entitled "AfraLisp Profile".
Note that the arguments for the "Target:" have been inserted and the "Start in:" directory has been
configured.
Now choose "Tools" - "Options" from the pull down menu and select the "Files" tab:
Of course, this is in no ways a full explanation of what "Inno Tools" or "Acad Install" are capable of.
They are both full of functions and capabilities that I haven't even touched on in this tutorial. Read the
help files, play around with them, have a wee bit of fun.
(Have a look here if you would like a more detailed look at "Acad Install".)
Sorry, coming soon!!
If you would like to download the all installation files for this tutorial, please feel free to click here.
Although "ACAD Install" was primarily written to work in conjunction with "Inno Setup" it can also be
used as a stand alone application. I find it particularly useful for configuring AutoCAD for a Network
environment.
In a Network environment there is no need for a full blown installation application, as all of the support
files, menu's, lisp files, etc. are already on the Network and are shared by each user. All we really
require is a method of configuring AutoCAD to suit our Network paths. This is where "Acad Install"
comes into play.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Personally, I feel that Command Line Switches are often neglected by the AutoCAD programmer/system
manager. Why? I don't know as they can drastically cut down on setting up workstations and help a hell
of a lot in enforcing drawing office standards.
Before we have a look at the Command Line Switches, let's have a look at how AutoCAD deals with
them :
● If you use a Command Line Switch to specify an environment setting, the Command Line Switch
overrides the settings specified in either the Options dialog box or the environment value.
● If a Command Line Switch is not set, the corresponding value set in the Options dialog box is
used.
● If neither a Command Line Switch nor an Options value is set, the environment variable value is
used
Note : Command Line Switches and environment variables override Options values for the current
session only. They do not alter the system registry.
Okay dokey, now let's have a look at how we go about changing a Command Line Switch :
● Make a backup copy of your AutoCAD 2002 icon. Right-click on the icon and then Copy and Paste it to a safe
location.
● Again, Right-Click on the AutoCAD 2002 icon on your Desktop.
● Choose Properties
● In the AutoCAD 2002 Properties dialog, select the Shortcut tab.
This is what it should look like :
The section that we are interested in is the "Target" edit box, which in this example contains "C:\AutoCAD
2002\acad.exe"
A word of warning though, when making changes to the Target box, make sure you don't accidentally remove any
section of the application path or filename itself, Make sure that there is a single space after the path and file
argument and before you switch. Also, ensure there is a space between each argument and your switch statements.
If your path or file names have spaces in them, you will have to surround the path or name with double quotes. In
fact, to be on the safe side, I surround all my paths and file names with double quotes.
Right, let's have a look at the switches :
You can of course string the Command Line Switches together. For example, to open AutoCAD with no
splash screen using a user defined profile and template drawing, you would use the following syntax :
"C:\AutoCAD 2002\acad.exe" /nologo /p "C:\profiles\MyProfile" /t "C:\MyTemplates\MyTemplate"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Although "ACAD Install" was primarily written to work in conjunction with "Inno Setup" - see "Custom
Application Setups" - it can also be used as a stand alone application. I find it particularly useful for
configuring AutoCAD for a Network environment.
In a Network environment there is no need for a full blown installation application, as all of the support files,
menu's, lisp files, etc. are already on the Network and are shared by each user. All we really require is a
method of configuring AutoCAD to suit our Network paths. This is where "Acad Install" comes into play. So,
let's have a look at setting up "Acad Install" to configure AutoCAD.
Pretty straight forward hey? "Network_Install" is the directory folder containing all our support folders and
files. You must remember that "AcadInst.exe" and "AcadInst.ini" must reside in the root folder of your
Network directory structure. The files in this folder will look something like this :
As you can see from the file listing above, "AcadInst"can now be renamed so that multiple installers can
coexist in same directory. The .ini file name should match .exe name
(AcadInst_1.exe/AcadInst_1.ini/AcadInst_2.exe/AcadInst_2.ini,...)
Any partial Menu must also reside in this folder as I haven't yet discovered a way to refer to a menu residing
in a sub-folder.
Okay, time to have a look at the "AcadIns.ini" file :
[PRODUCT]
[AUTOCAD]
Versions=R16.0
;Comma-delimited string representing the versions of AutoCAD
; for which the application can/will* be installed.
;Valid strings are any key found under
;HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD in the registry.
;When left empty all profiles that match the other criteria are included.
;To avoid all versions enter NONE.
;Examples for AutoCAD are R14.0 for R14, R15.0 for 2000,
;2000i, & 2002, and R16.0 for 2004
;Examples for LT are R5.0 for LT98, R2000 for LT 2000,
;R7 for LT 2000i, and R8 for LT2002
[MENU]
MenuGroups=AFRALISP:AFRALISP:1:50
;Comma-delimited string of MENUGROUP:MENUFILE:POP:POSITION
;(without extensions) to be added to the Menu key for the profiles.
;The registry is searched and the first available Group number is used.
;If POSITION ;is greater than the number of installed pop menus,
;then it will be added to the end. To insert at the beginning
;use 1. To insert at the end use some large number like 50.
;If the POP and POSITION numbers are not included
;then no drop-down menu is installed for that menu.
;Example:
;MenuGroups=MyMainMenu:MyMenuFile:1:3,MyOtherMenu:MyMenuFile
Toolbars=AFRALISP.LAYMAN
;Comma-delimited string of MENUGROUP.TOOLBAR pairs to be
;added to the AutoCAD GUI. If the user has previously closed one
;of the toolbars it will be forced to show itself again after
;running installer.
[APPLOAD]
;For both of these keys you must use < InstallPath > to insert the user
;specified path when appropriate.
;See the AddPath= key for more information.
[NEWPROFILE]
Name=AfraLisp
;Name for the new profile. If it already exists,
;the rest of the keys are skipped.
;A profile will be created for all AutoCAD apps specified in the
;[AUTOCAD] and [AUTOCAD LT] sections.
DesktopShortcut=T
;Add a shortcut to the desktop
ShortcutName=AfraLisp 2004 Menu Profile
;Shortcut Name
ShortcutComment=AfraLisp 2004 Menu Profile
;Tooltip
ShortcutArgs=/p "AfraLisp"
;the arguments on startup
ShortcutWorkingDir=< InstallPath >\Admin
;the working directory
[<PROFILE>General]
Do you notice how we make use of <InstallPath> to indicate the path the user installed to. Using this you can
also add paths relative to the path where the user installed, for example <InstallPath>\Symbols|2 would add a
sub-folder of the installed path named Symbols as the second entry in the support paths list.
Right, that's everything set up and ready. Double click on "AcadInst-admin.ini" and see what happens :
Now it's asking us what Profile would we like to base our new Profile on, and which of our Installed AutoCAD
versions would we like to install too. Pick a Profile, any will do and then select "OK."
Mmmm, nothing really seemed to happen??
Don't worry, plenty did it's just that it all happened so fast.
Have a look at your desktop :
Ha, ha, we have a new desktop icon. Right-click on the icon and select "Properties" and then the "Shortcut"
tab :
This is getting more and more interesting. Now choose "Tools" - "Options" -"Files" and have a look at your
support path :
Yippee, it's there. Now where has our menu gone? Check out your menu bar :
Okay, that's our installation complete, but what happens when we want to uninstall?
To uninstall you can run it from the command line (Start->Run) passing -U as the single parameter :
ECHO OFF
CLS
ECHO Uninstalling from AutoCAD
PAUSE
AcadInst.exe -U
ECHO Files Uninstalled!
PAUSE
If you would like to download all the files involved in this tutorial then please feel free to click on this spot
here.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Onsnap Menu
Here is a little trick that I did to my osnap cursor menu.I come across a lot of users who are not aware of this
function, 'Cal - Mee.
I used to use a 12 button puck & tablet and had this programmed on button #4. Now, in the modern world of the
InteliMouse, I have given up my beloved tablet, so here is what I have done to my AutoCad menu.
John Lauer
A. If you use "Acad.lsp" or "Acaddoc.lsp" or similar at startup you could put the following piece of code
in one of these files; it will ensure that you get the number of command lines you want.
multiplier 25173
increment 13849
Applying Points.
I received this from Roger Farley:
I was browsing your tips and tricks area and thought I would contribute a gem:
These four lines will give you the extreme four values in a points list:
where PointList is a list of 2D or 3D points (like a list of pline vertex points),
(setq X1 (apply 'min (mapcar 'car PointList)))
; The smallest 'X' value
(setq Y1 (apply 'min (mapcar 'cadr PointList)))
; The smallest 'Y' value
(setq X2 (apply 'max (mapcar 'car PointList)))
; The largest 'X' value
(setq Y2 (apply 'max (mapcar 'cadr PointList)))
; The largest 'Y' value
Then assemble like:
Roger Farley
(defun c:example ()
(setq oldhigh (getvar "Highlight")
oldsnap (getvar "Osmode")
oldblip (getvar "BlipMode")
oldecho (getvar "Cmdecho")
);setq
(setvar "Highlight" 0)
(setvar "Osmode" 517)
(setvar "Blipmode" 0)
(setvar "Cmdecho" 0)
Programme statements.............
.................................
(defun varget ()
(setq no 0)
;set counter to zero
);repeat
(princ);finish quietly
);defun
;***************************************************************
(defun varset ()
(setq no 0)
;set counter to zero
);repeat
(princ);finish quietly
);defun
;***************************************************************
(princ);load quietly
(varget)
;store system variables and then reset them
Programme statements.............
.................................
(varset)
;restore system variables
(princ)
);defun
;******************************************************
Creating Defaults.
In many AutoCAD commands, AutoCAD remembers the last entry and puts that entry between angle
brackets (<>).
Then all you have to do is press Enter, and that value is used. You should use that technique whenever
you're creating your own defaults in AutoLISP.
First make sure that you haven't declared as local the variable that will hold the value. Then follow a
three-step process :
Require input from the user and assign that input to a second variable.
● Test to see if the input is nil, and if it is nil, assign a global variable
to the real variable.
● Finally, assign the real variable to the global variable.
● You're then ready for the next sequence.
Here's an example :
(defun c:prog1 (/ a)
(if (= gv nil)
(setq gv 1.0)
);end if
(setq gv a)
(princ "\nThe Distance is ")
(princ a)
(princ)
);defun
gv is the global variable.
No matter how often you run this routine while in the same drawing, it will maintain the last entry as the
This converts the value of the string variable t to uppercase and assigns
the new value to the variable uc.
Break @ Circle.
Have you ever tried breaking a Circle into 2 separate parts using the Break command? It doesn't work
does it? This routine allows you to separate a circle into two arcs by picking
two points on the circle.
(defun c:bcirc (/ os pt1 pt2 a pt3)
(setq os (getvar "osmode"))
(setvar "osmode" 512)
(setq pt1 (getpoint "\nFirst Break in Circle : "))
(setq pt2 (getpoint "\nSecond Break in Cricle : "))
(setq a (entget (ssname (ssget pt1) 0)))
(setq pt3 (cdr (assoc 10 a)))
(command "break" pt1 pt2)
(command "arc" pt1 "e" pt2 pt3)
(setvar "osmode" os)
(princ)
)
(princ)
Pick any 2 points on the a Circle.
The circle will look the same, but it will be broken into two arcs.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Page I Page II
If the menu file is currently loaded, this will return a nonnil value
otherwise it will return nil.
;;*-------------------------------------------------------------------
(defun S::STARTUP ()
;define Startup function
(progn
;if it is not loaded
(setvar "filedia" 0)
;suppress dialog boxes
(menucmd "P8=+TEST.POP1")
;load POP1
(menucmd "P9=+TEST.POP2")
;load POP2
(setvar "filedia" 1)
;restore dialogs
);progn
);if
(princ)
);defun
;*---------------------------------------------------------------------
Existing S::STARTUP
Because an S::STARTUP function can be defined in many places (an acad.lsp file, a .mnl file, or any other AutoLISP
file loaded from either of these), it's possible to overwrite a previously defined S::STARTUP function. The following
example shows one method of ensuring that
your start-up function works with other functions.
(defun MYSTARTUP ()
....Your Start Up Function....
)
Mapcar
Have you ever wondered where you would use the MAPCAR function?
Here is a perfect example :
Say you have a list of data stored in variable arglist
You want to place each item in the list in it's own variable to use in your routine. One way to do it would be as follows
:
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
"Utter Rubbish"
Page III
=====================
Two Irish men walk into a pet shop. Right away they go over to the bird section.
Gerry says to Paddy, "Dat's dem!"
The clerk comes over and asks if he can help them.
"Yeah, we'll take four of dem dere birds in dat cage dere," says Gerry, "Put dem in a peeper bag."
The clerk does and the two guys pay for the birds and leave the shop.
They get into Gerry's van and drive until they are high up in the hills and stop at the top of a cliff with a
500-foot drop.
"Dis looks like a grand place, eh?" says Gerry.
"Oh, yeh, dis looks good," replies Paddy.
They flip a coin and Gerry wins the toss.
"I guess I git to go first, eh Paddy?" says Gerry.
He then takes two birds out of the bag, places them on his shoulders and jumps off the cliff.
Paddy watches as his mate drops off the edge and goes straight down for a few seconds followed by a
'SPLAT'.
As Paddy looks over the edge of the cliff he shakes his head and says,
"Fock dat, dis budgie jumpin' is too fockin' dangerous for me"
A minute later, Seamus arrives. He too has been to the pet shop and he, walks up carrying the familiar
peeper bag.
He pulls a parrot out of the bag, and then Paddy notices that, in his other hand, Seamus is carrying a
gun.
"Hi, Paddy. Watch this," Seamus says and launches himself over the edge of the cliff.
Paddy watches as half way down, Seamus takes the gun and blows the parrot's head off.
Seamus continues to plummet until there is a SPLAT!, as he joins Gerry's remains at the bottom.
Paddy shakes his head and says, "An' oim never troyin' dat parrotshooting nider"
A few minutes after Seamus splats himself Sean strolls up. He too has been to the pet shop and he
walks up carrying the familiar
'peeper bag'. Instead of a parrot he pulls a chicken out of the bag, and launches himself off the cliff with
the usual result.
Once more Paddy shakes his head -
"Fock me Sean, first der was Gerry with his budgie jumping, den Seamus parrotshooting and now you
fockin' hengliding!"
===============
The big guy sees little Mike staring at him, looks down and says, "7 feet tall, 350lbs, 20inch penis,
testicles 3lbs each, Turner Brown."
The big dude kneels down and brings him to by slapping his face and shaking him. He asks, "Are you
OK??"
In a very weak voice Mike says, "Excuse me, but what did you just say to me?"
The big dude says, "When I saw the curious look on your face, I just figured I'd give you the answers to
the questions everyone always asks me. "I'm 7 feet tall, weigh 350lbs, have a 20 inch penis, my testicles
weigh 3lbs each, and my name is Turner Brown."
Mike said, "Oh Thank God!!! .... I thought you said "Turn Around!!"
=============
Bob joins a very exclusive nudist colony. On his first day he takes off his clothes
and starts wandering around. A gorgeous petite blonde walks by him and the man
immediately gets an erection.
The woman notices his erection, comes over to him grinning sweetly and says:
"Sir, did you call for me?"
Bob replies: "No, what do you mean?"
She says: "You must be new here; let me explain. It's a rule here that if I give you an erection,
it implies you called for me." Smiling, she then leads him to the side of a pool, lays down on a
towel, eagerly pulls him to her and happily lets him have his way with her.
Bob continues exploring the facilities. He enters a sauna, sits down, and farts.
Within a few seconds a huge, horribly corpulent, hairy man with a firm erection lumbers out
of the steam towards him. The Huge Man says: "Sir, did you call for me?"
Bob replies: "No, what do you mean?"
The Huge Man: "You must be new here; it is a rule that when you fart, it implies you called for me."
The huge man then easily spins Bob around, bends him over the bench and has his way with him.
Bob rushes back to the colony office. He is greeted by the smiling naked receptionist:
"May I help you?"
Bob says: "Here is your card and key back. You can keep the $500 joining fee."
Receptionist: "But Sir, you've only been here a couple of hours;
you only saw a small fraction of our facilities.....
======================
1-Star Hangover *
No pain. No real feeling of illness. You slept in your own bed and when you woke up there were no
traffic cones in there with you. You are still able to function relatively well on the energy stored up from
all those vodka red bulls. However, you can drink 10 bottles of water and still feel as parched as the
Sahara. Even vegetarians are craving a Cheeseburger and a side of fries.
2-Star Hangover * *
No pain, but something is definitely amiss. You may look okay but you have the attention span and
mental capacity of a stapler. The coffee you hug to try and remain focused is only exacerbating your
rumbling gut, which is craving a full English breakfast. Although you have a nice demeanour about the
office, you are costing your employer valuable money because all you really can handle is some light
filing, followed by aimlessly surfing the net and writing junk e-mails.
3-Star Hangover * * *
Slight headache. Stomach feels crap. You are definitely a space cadet and not so productive. Anytime a
girl or lad walks by you gag because her perfume/aftershave reminds you of the random gin shots you
4-Star Hangover * * * *
You have lost the will to live. Your head is throbbing and you can't speak too quickly or else you might
spew. Your boss has already lambasted you for being late and has given you a lecture for reeking of
booze. You wore nice clothes, but you smell of socks, and you can't hide the fact that you either
missed an oh-so crucial spot shaving or it looks like you put your make-up on while riding the dodgems
depending on your gender. Your teeth have their own individual sweaters. Your eyes look like one big
vein and your hairstyle makes you look like a reject from the second-grade class picture circa 1976.
You would give a week's pay for one of the following: _Home time, doughnut and somewhere to be
alone, or a Time machine so you could go back and NOT have gone out the night before. You scare
small children in the street just by walking past them.
5-Star Hangover * * * * *
You have a second heartbeat in your head, which is actually annoying the employee who sits next to
you. Vodka vapour is seeping out of every pore and making you dizzy. You still have toothpaste crust in
the corners of your mouth from brushing your teeth. Your body has lost the ability to generate
saliva, so your tongue is suffocating you. You'd cry but that would take the last of the moisture left in
your body. Death seems pretty good right now.
Your boss doesn't even get mad at you and your co-workers think that your dog just died because you
look so pathetic. You should have called in sick because, let's face it, all you can manage to do is
breathe...very gently.
6-Star Hangover * * * * * *
You arrive home and climb into bed. Sleep comes instantly; as you were fighting it all the way home in
the taxi. You get about 2 hours sleep until the noises inside your head wake you up. You notice that
your bed has been cleared for take off and is flying relentlessly around the room. No matter
what you do you now, you're going to chuck. You stumble out of bed and now find that your room is in a
yacht under full sail. After walking along the skirting boards on alternating walls knocking off all the
pictures, you find the toilet. If you are lucky you will remember to lift the lid before you
spontaneously explode and wake the whole house up with your impersonation of walrus mating calls.
You sit there on the floor in your undies, Cuddling the only friend in the world you have left (the toilet),
randomly continuing to make the walrus noises, spitting, and farting. Help usually comes at this
stage, even if it is short lived. Tears stream down your face and your abdomen hurts. Help now turns
into abuse and he/she usually goes back to bed leaving you there in the dark. With your stomach totally
empty, your spontaneous eruptions have died back to 15-minute intervals, but your body won't relent.
You are convinced that you are starting to turn yourself inside out and swear that you saw your tonsils
projectile out your mouth on the last occasion. It is now dawn and you pass your disgusted partner
getting up for the day as you try to climb into bed. She/He abuses you again
for trying to get into bed with lumpy bits of dried vomit in your hair. _You reluctantly accept their advice
and have a shower in exchange for them driving you to the hospital. Work is not an option.
===============
Unauthorized Activity
***************************
The Department has been informed that one or both of the dams
partially failed during a recent rain event, causing debris and
flooding at downstream locations. We find that dams of this
nature are inherently hazardous and cannot be permitted. The
Department therefore orders you to cease and desist all activities
at this location, and to restore the stream to a free-flow
condition by removing all wood and brush forming the dams from the stream channel. All restoration
work shall be completed no later than
January 31, 2002.
Please notify this office when the restoration has been completed
so that a follow-up site inspection may be scheduled by our staff.
Failure to comply with this request or any further unauthorized
activity on the site may result in this case being referred for
elevated enforcement action.
*******************
First of all, Mr. Ryan DeVries is not the legal Landowner and/or
Contractor at 2088 Dagget, Pierson, Michigan. I am the legal
owner and a couple of beavers are in the (State unauthorized)
process of constructing and maintaining two wood "debris" dams
across the outlet stream of my Spring Pond.
While I did not pay for, authorize, nor supervise their dam
project, I think they would be highly offended that you call their
skillful use of natures building materials "debris."
As to your request, I do not think the beavers are aware that they
must first fill out a dam permit prior to the start of this type of
dam activity.
So, as far as the beavers and I are concerned, this dam case can
be referred for more elevated enforcement action right now. Why
wait until 1/31/2002? The Spring Pond Beavers may be under the
dam ice then and there will be no way for you or your dam staff to
contact/harass them then.
Being unable to comply with your dam request, and being unable
to contact you on your dam answering machine, I am sending this
response to your dam office.
Sincerely,
Stephen L.Tvedten
===================
One night, a police officer was staking out a particularly rowdy bar for possible violations of the driving
under the influence laws.
At closing time, he saw a fellow stumble out of the bar, trip on the curb, and try his keys on five different
cars before he found his. Then, sat in the front seat fumbling around with his keys for several minutes.
Everyone else then left the bar and drove off.
Finally, the guy sitting in his car started his engine and began to pull away.
The police officer was waiting for him. He stopped the driver, read him his rights and administered the
Breathalyzer test. The results showed a reading of 0.0 % !
The puzzled officer demanded to know how that could be.
The driver replied, "Tonight, I'm the Designated Decoy."
=================
GENERAL:
1. Never take a beer to a job interview.
2. Always identify people in your yard before shooting them.
3. If you have to vacuum the bed, it's time to change the sheets.
4. Even if you're certain you're included in the will, it's rude to take the trailer to the funeral home.
DINING OUT:
1. When decanting wine from the box, tilt the paper cup and pour slowly so as not to "bruise" the wine.
2. If drinking directly from the bottle, hold it with only one hand.
PERSONAL HYGIENE:
1. While ears need to be cleaned regularly, this should be done in private, using one's OWN keys.
2. Even if you live alone, deodorant isn't a waste of money.
3. Use of toiletries can only delay bathing a few days.
4. Dirt and grease under the fingernails is a no-no, as it detracts from a woman's jewelry and alters the
taste of finger foods.
THEATRE ETIQUETTE:
1. Crying babies should be taken to the lobby and picked up after the movie ends.
2. Refrain from talking to characters on the screen. Tests have proven they can't hear you.
WEDDINGS:
1. Livestock is a poor choice for a wedding gift.
2. Kissing the bride for more than five seconds may get you shot.
3. For the groom, at least, rent a tux. A track suit with a cummerbund and a clean football jumper can
create a tacky appearance.
4. Though uncomfortable, say "yes" to socks and shoes for the occasion.
DRIVING ETIQUETTE:
1. Dim your headlights for approaching vehicles, even if the gun's loaded and the drivers heads in sight.
2. When approaching a round-about, the vehicle with the largest tyres doesn't always have the right of
way.
3. Never tow another car using panty hose and duct tape.
4. When sending your wife down the road with a petrol can, it's impolite to ask her to bring back beer,
too.
=================
Politics..
Returning from school one day, little Johnny goes to his father and asks:
- Dad, our teacher mentioned during the history class today one word I didn't know...
- Yes son...?
-It's "politics", dad. Could you explain me what it means?
- Well now, Johnny - says his father while frowning - that's a rather complex term.. especially for
someone as young as you; to make it easier, let's put it into your perspective: I am your father. I work
and bring money to this house. I make all of the most important decisions. Therefore let's call me
Capitalism. Your mum, she run's the household - so she's something like a Government around here.
Our maid does most of the toil around the house - so she can be the Working Class. You son, let's call
you The People. And your little baby brother is our youngest family member - hence he's the future.
That's pretty much how politics works, son. Was that good enough for you?
-Well, thank's dad. It was a bit confusing though. I'll have to sleep on it a bit and see whether I can
understand it tomorrow..
Later that night, Johnny suddenly wakes up. He's hungry. On the way to the kitchen, he hears his little
brother screaming from his cot. So he sneaks to his room, takes a good look around, and finds his
sibling in soiled pampers ;-) The stench is unbearable. And since Johnny is only a 9-year old kid, with
no baby-training, he shouts for his parents.
Nothing. He shouts again, only louder. Still nothing. Quite frustrated with the situation at hand, he heads
for his parents' bedroom, where he finds his mother fast asleep, but no trace of the "patter familias".
=================
No premarital sex.
No Booze. None. Never.
No TV. No cable TV. No satellite TV
No Spice channel. No Playboy channel. No ESPN. No Hooters!
No Sports Illustrated Swimsuit Edition.
Sand. F*ckin' sand everywhere!
No organized sports of any kind. That's right No Sports!
Women are to be completely covered and wear veils.
No thongs. No Victoria's Secret.
Very, very few cars.
Camels. Lots of camels. Stinking, filthy camels.
Sand. F*ckin' sand everywhere!
Ever try to fish at an Oasis? No bass boats. No bass. No fish.
Sandstorms. More f*ckin' sand everywhere!
Rags for clothes and dishcloths with fanbelts for hats.
Camel and goat burgers cooked over burning camel dung chips.
Eating with your right hand only because you wipe your butt
with your left.
Toilet tissue is unknown.
Sand. F*ckin' sand everywhere!
No Golf. Just sand traps.
Constant wailing next door...no wait, that's their music.
Praying 5 times a day. For what? More of this life?
Oh, and did I mention the f*ckin' sand?
And when you die it's supposed to get better.
No wonder they volunteer for suicide missions!!
================
An elderly Italian man asked the local priest to hear his confession:
"Father, during World War 2 a beautiful woman knocked on my door and asked me to hide her from the
Germans. I hid her in my attic".
The priest replied, "That was a wonderful thing you did and you have no need to confess."
"It's worse, Father. I was weak and told her she must repay me with sexual favours."
"You were both in great danger and would have suffered terribly if the Germans had found her. God, in
his wisdom and mercy, will balance the good and the evil and judge you kindly. You are forgiven."
"Thank you, Father, That's a great load off my mind. I have one more question."
The old man replied, "Should I tell her the war is over?
=================
4. "This project is so important, we can't let things that are more important interfere with it".
(Advertising/Marketing manager, United Parcel Service)
6. "No one will believe you solved this problem in one day! We've been working on it for months. Now,
go act busy for a few weeks and I'll let you know when it's time to tell them". (R&D supervisor,
Minnesota Mining and Manufacturing/3M Corp.)
7. "My Boss spent the entire weekend retyping a 25-page proposal that only needed corrections. She
claims the disk I gave her was damaged and she couldn't edit it. The disk I gave her was
write-protected". (CIO of Dell Computers)
8. Quote from the Boss: "Teamwork is a lot of people doing what I say".(Marketing executive, Citrix
Corporation)
9. My sister passed away and her funeral was scheduled for Monday. When I told my Boss, he said she
died on purpose so that I would have to miss work on the busiest day of the year. He then asked if we
could change her burial to Friday. He said, "That would be better for me". (Shipping executive, FTD
Florists)
10. "We know that communication is a problem, but the company is not going to discuss it with the
employees". (Switching supervisor, AT&T Long Lines Division)
11. We recently received a memo from senior management saying: "This is to inform you that a memo
will be issued today regarding the memo mentioned above". (Microsoft, Legal Affairs Division)
12. One day my Boss asked me to submit a status report to him concerning a project I was working on. I
asked him if tomorrow would be soon enough. He said, "If I wanted it tomorrow, I would have waited
until tomorrow to ask for it!" (New business manager,Hallmark Greeting Cards.)
13. As director of communications, I was asked to prepare a memo reviewing our company's training
programs and materials. In the body of the memo in one of the sentences I mentioned the "pedagogical
approach" used by one of the training annuals. The day after I routed the memo to the executive
committee, I was called into the HR director's office, and told that the executive vice president wanted
me out of the building by lunch. When I asked why, I was told that she wouldn't stand for perverts
(paedophiles?) memo, with her demand that I be fired - and the word "pedagogical" circled in red. The
HR manager was fairly reasonable, and once he looked the word up in his dictionary and made a copy
of the definition to send back to her, he told me not to worry. He would take care of it. Two days later, a
memo to the entire staff came out directing us that no words which could not be found in the local
Sunday newspaper could be used in company memos. A month later, I resigned. In accordance with
company policy, I created my resignation memo by pasting words together from the Sunday
paper.
(Taco Bell Corporation)
================
An old cowboy went to a bar and ordered a drink. As he sat there sipping whiskey, a young lady sat
down next to him.
He replied, "Well, I've spent my whole life on the ranch, herding cows, breaking horses, mending fences,
so I guess I am." He then asked her what she was.
She replied, "I'm a lesbian. I spend my whole day thinking about women. As soon as I get up in the
morning I think of women, when I eat, shower, watch TV, everything seems to make me think of
women."
A little while later a couple sat down next to the old cowboy and asked him, "Are you a real cowboy?"
He replied, "I always thought I was, but I just found out I'm a lesbian."
=================
A little girl walks into a pet shop and asks in the sweetest little
lisp, "Excuthe me, mithter, do you keep wittle wabbits?"
The shopkeeper gets down on his knees, so that he's on her level, and asks,
"Do you want a likkle white wabbit? Or a soft and fuwwy black wabbit? Or maybe one like that cute
likkle brown wabbit over there?"
She in turn puts her hands on her knees, leans forward and says in a quiet voice, "I don't fink my pyfon
weally gives a phuck!"
==================
A man left work one Friday afternoon. But being payday, instead of going home he partied with the boys
and stayed out all weekend, spending his entire paycheck.
When he finally appeared at home on Sunday night, he was confronted by a very angry wife and was
barraged for nearly two hours with a tirade befitting his actions.
Finally his wife stopped the nagging and simply said to him. "How would you like it if you didn't see me
for two or three days?"
Monday went by and he didn't see his wife. Tuesday and Wednesday came and went with the same
results. Come Thursday, the swelling went down just enough where he could see her a little out of the
corner of his left eye.
================
The Washington Post's Style invitational asked readers to take any word from the dictionary, alter it by
adding, subtracting, or changing one letter, and supply a new definition. Here are some recent winners:
Intaxication: Euphoria at getting a tax refund, which lasts until you realize it was your money to start
with.
Bozone (n.): The substance surrounding stupid people that stops bright ideas from penetrating. The
bozone layer, unfortunately, shows little sign of breaking down in the near future.
Foreploy: Any misrepresentation about yourself for the purpose of getting laid.
Cashtration (n.): The act of buying a house, which renders the subject financially impotent for an
indefinite period.
Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.
Karmageddon: It's like, when everybody is sending off all these really bad vibes, right? And then, like,
the Earth explodes and it's like, a serious bummer.
Decaflon (n.): The gruelling event of getting through the day consuming only things that are good for
you.
Dopeler effect: The tendency of stupid ideas to seem smarter when they come at you rapidly.
Arachnoleptic fit (n.): The frantic dance performed just after you've accidentally walked through a spider
web.
Caterpallor (n.): The color you turn after finding half a grub in the fruit you're eating.
===================
Helpful Hint #1
If you are choking on an ice cube, don't panic. Simply pour a jug of boiling water down your throat and
presto! The blockage is almost instantly removed.
Helpful Hint #2
Clumsy? Avoid cutting yourself while slicing vegetables by getting someone else to hold them while
you chop away
Helpful Hint #3
Don't buy expensive 'ribbed' condoms, just buy an ordinary one and slip a handful of frozen peas inside
it before you put it on.
Helpful Hint #4
Putting just the right amount of gin in your goldfish bowl makes the fishes' eyes bulge and cause them
to swim in an amusing manner.
Helpful Hint #5
An empty aluminum cigar tube filled with angry wasps makes a wonderful inexpensive vibrator.
Helpful Hint #6
Avoid arguments with the missus about lifting the toilet seat by simply pissing in the sink.
Helpful Hint #7
High blood pressure sufferers: ! simply cut yourself and bleed for a while,thus reducing the pressure in
your veins.
Helpful Hint #8
A mouse trap, placed on top on of your alarm clock, will prevent you from rolling over and going back to
sleep.
Helpful Hint #9
If you have a bad cough, take a large dose of laxatives, then you will be afraid to cough!
====================
President Bush and Colin Powell are sitting in a bar. A guy walks in, spots them and asks the bartender,
"Isn't that Bush and Powell sitting over there?"
The bartender answers, "Yep, that's them."
So the guy walks over and says, "Wow, this is a real honor. What are you guys doing in here?" Bush
says, "We're planning WW III."
"World War III!" the guy exclaims. "Really? What's going to happen?"
Bush says, "Well, we're going to get rid of Saddam Hussein and kill 140 million Iraqis and one blonde
with big breasts."
The guy looks puzzled. "A blonde with big breasts? Why kill a blonde with big breasts?"
Bush turns to Powell, punches him on the shoulder and says, "See. I told you no one would worry about
the 140 million Iraqis!"
=================
Rev Jackson is sat in a bar with Prince Charles when he asks him:
"Hey, Charlie boy, why is Britain called a Kingdom?
Charles answers, "Because it's run by a King."
The Rev replies, "Oh, I suppose that's why they call America a country."
======================
Keep the seat next to you on the train vacant by smiling and
nodding at people as they walk up the aisle.
Make bath times as much fun for kiddies as a visit to the seaside
by pouring a bucket of sand, a bag of salt and a dog turd into the
bath.
Don't buy expensive 'ribbed' condoms, just buy an ordinary one and
slip a handful of frozen peas inside it before you put it on.
Putting just the right amount of gin in your goldfish bowl makes
the fishes' eyes bulge and cause them to swim in an amusing manner.
Anorexics. When your knees become fatter than your legs, start
eating cakes again.
Avoid arguments with the missus about lifting the loo seat by
simply pi**ing in the sink.
Spice up your sex life by trying a bit of 'rodeo sex'. Take your
missus from behind and, holding on tightly to her jugs, call her by the
wrong name. See how long you can 'stay mounted' for.
Give comics that 'Pulp Fiction' feel by reading the last frames of
cartoons first, then reading the rest in a random order.
High blood pressure sufferers. Simply cut yourself and bleed for a
while, thus reducing the pressure in your veins.
Heavy smokers. Don't throw away those filters from the end of your
cigarettes. Save them up and within a few years you'll have enough
to insulate your loft.
Have all your dumps at work. Not only will you save money on
toilet paper, but you'll also be getting paid for it.
=============================
Then years later the salesman visited the same little town and saw a
faded sign for the same circus and the same sign: "Don't Miss The Amazing Scotsman".
He couldn't believe the old guy was still alive much less still doing his act! He bought a ticket. Again, the
centre ring was illuminated. This time, however, instead of walnuts, three coconuts were placed on the
table.
The Scotsman stood before them, then suddenly lifted his kilt and
smashed the coconuts with three swings of his amazing member. The crowd went wild! Flabbergasted,
the salesman requested a meeting with him after the show.
"You're incredible!" he told the Scotsman. "But I have to know something. You're older now, why switch
from walnuts to coconuts?"
====================
The weather in Iraq tomorrow is expected to be sunny in the morning with increasing mushroom clouds
in the afternoon. The temperature looks to be a moderate 2000 degrees with cool winds upwards of
around 700 miles per hour. It will definitely be a day for the sunblock, and it wouldn't hurt to shake the
dust off the ol' lead suit in the closet. If you're planning on venturing outside in beautiful Iraq tomorrow,
don't forget to drink plenty of fluids such as barium which shows up nicely when blasts of radiation flow
through your body. Most of all, have fun out there in dusty Iraq and enjoy the old country while........
well, while it's still there.
==================
A little rabbit is happily running through the forest when he stumbles upon a giraffe rolling a joint. The
rabbit looks at her and says, "Giraffe my friend, why do you do this? Come with me running through the
forest, you'll see, you'll feel so much better!"
The giraffe looks at him, looks at the joint, tosses it and goes off running with the rabbit.
Then they come across an elephant doing coke, so the rabbit again says, "Elephant my friend, why do
you do this? Think about your health! Come running with us through the pretty forest, you'll see, you'll
feel so good!"
The elephant looks at them, looks at his razor, mirror and all, then tosses them and starts running with
the rabbit and giraffe.
The three animals then come across a lion about to shoot up heroin..."Lion my friend, why do you do
this? Think about your health! Come running with us through the sunny forest, you will feel so good!"
The lion looks at him, puts down his needle, and starts to beat the shit out of the little rabbit.
The giraffe and elephant watch in horror, and ask him "Lion, why did you do this? He was merely trying
to help us all!"
The lion answers, "Every time he's on Ecstasy that little f**ker makes me run around the forest like an
idiot for hours!"
==============
==================
An American decided to write a book about famous churches around the world. For his first chapter he
Next stop was in Wales. There, at a very large cathedral, he saw the same golden telephone with the
same sign under it. He wondered if this was the same kind of telephone he saw in London and he asked
a nearby nun what its purpose was. She told him that it was a direct line to heaven and that for $10, 000
he could talk to God. "O.K., thank you," said the writer. He then travelled to Dublin in Ireland. In every
church he saw the same golden telephone with the same "$R10, 000 per call" sign under it.
The American, upon leaving Dublin saw a sign for Glasgow and decided to see if Glaswegians had the
same phone. He arrived in Glasgow, and again, there was the same golden telephone, but this time the
sign under it read "50 cents per call." The writer was surprised so he asked the priest about the sign.
"Father, I've travelled all over Britian and I've seen this same golden telephone in many churches. I'm
told that it is a direct line to Heaven, but in every place the price was $10, 000 per call. Why is it so
cheap here?" The priest smiled and answered, "You're in the Scotland now son, it's a local call".
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
"Utter Rubbish"
Page IV
Mergers
========
In the wake of the Exxon/Mobil deal and the AOL/Netscape deal, here are the next bombshell mergers,
investors should expect:
Hale Business Systems, Mary Kay Cosmetics, Fuller Brush, and W.R. Grace Company merge to become,
Hale Mary Fuller Grace.
Polygram Records, Warner Brothers, and Keebler Crackers merge to become, Polly Warner Cracker.
Zippo Manufacturing, Audi Motors, Dofasco, and Dakota Mining merge to become,
Zip Audi Do Da.
Xerox and Wurlitzer will merge and begin manufacturing Reproductive Organs.
Fairchild Electronics and Honeywell Computers will merge and become Fairwell Honeychild
Knott's Berry Farm & National Organization of Women will merge and become, Knott NOW.
----------------------------
A photographer for a national magazine was assigned to take pictures of a great forest fire. He was
advised that a small plane would be waiting to fly him over the fire.
The photographer arrived at the airstrip just an hour before sundown. Sure enough, a small Cessna
airplane was waiting. He jumped in with his equipment and shouted, "Let's go!" The tense man sitting in
the pilot's seat swung the plane into the wind and soon they were in the air, though flying erratically.
"Fly over the north side of the fire," said the photographer, "and make several low-level passes."
"Why?" asked the nervous pilot. "Because I'm going to take pictures!" yelled the photographer. "I'm a
photographer, and photographers take pictures."
After a long pause, the "pilot" replied: "You mean, you're not my instructor?"
-----------------------
In 1950: A logger sells a truckload of lumber for $100. His cost of production is four-fifths of the price.
What is his profit?
In 1960: A logger sells a truckload of lumber for $100. His cost of production is four-fifths of the price, or
$80. What is his profit?
In 1970 (new math): A logger exchanges a set L of lumber for a set M of money. The cardinality of set M
is 100, and each element is worth $1.00. Make 100 dots representing the elements of the set M. The set C
In 1980: A logger sells a truckload of lumber for $100. His cost of production is $80, and his profit is $20.
Your assignment: underline the number 20.
In 1990: (outcome-based education): By cutting down beautiful forest trees, a logger makes $20. What
do you think of this way of making a living? (Topic for class participation: How did the forest birds and
squirrels feel?)
In 2000: By laying off 40% of its loggers, a company improves its stock price from $80 to $100. How
much capital gain per share does the CEO make by exercising his stock options at $80? Assume capital
gains are no longer taxed, because this encourages investment.
==============
Alfa
Passionate and romantic, you fancy yourself. A bit unreliable, and can
be eccentric too. You hate BMW drivers, but think and act just like
them.
Audi
You would like to believe you are part of the new generation that is
caring, environmentally conscious and family-orientated. Actually, quite
boring, nothing more than a glorified wuss. Will one day probably drive
a Merc, but you still sometimes wonder if you shouldn't have bought that
Bee-Em.
BMW
Self-centred, ambitious, dynamic and assertive. Buppies and kugels
past sell-by date. You think you will be CEO one day. Actually an office
weenie who thinks you are God's gift.
Daewoo
Faceless, subservient and demure (except for Matiz drivers). To you,
a good deal is to work from nine to five, get nothing for it, and still
say thank you. And then you wonder why you don't have money for a good time
after hours.
Ford
You still live in the 70's, trying to cope with the 90's
(don't even mention the millennium). A loyal, diligent worker, but
baffled by office politics and labour policies. Next car will probably
also be a Ford.
Honda
You aspire to drive a BMW. You are an opinionated pain-in-the-butt.
The ultimate suffragette, or the boss's girlfriend (male or female!.
Hyundai
Quite progressive, intelligent and practical. But misguided. The kind
of person who will suggest a sub-committee to find solutions to what the
committee couldn't. You will always maintain that a Korean car is
better than any Japanese model.
Jeep
You would like to believe you are living the American dream and just
love the great outdoors. The closest you get to it is by watching Days
of Our Lives and the Adventure Channel.
Land Rover
You are a designer person with a designer life, who always pays too
much for everything. Designer mud comes free with the badge. If you have
a Freelander, it was probably a break-up gift from your ex.
Mazda
A Ford driver with more money. Mostly staid boring with no image and
less imagination.
Mercedes-Benz
Responsible, immaculate and conservative. Boring CEO clones with too
much money, or the office super-geek who can't remember what it's like
Nissan
Good, solid, responsible, loyal office-fodder. You like to travel and
maintain that you can sell ice to the Eskimos. Favourite answer:
It's a company car."
Opel
Wannabe Schumachers.
Always in a rush, but never get anything done.
Pajero
Not as label-conscious as your Land Rover counterpart, but still
suckered into believing in the ultimate African adventure. You drive
through puddles to create your own designer mud. You believe you've made the
grade, but everyone else knows you've got a long way to go.
Renault
An eccentric who likes doing things the wrong way around. Usually the
one who asks all the silly questions at staff meetings. You fervently
believe you have flair, but it's less than that of a French cookbook.
Ssangyong
A make-believe fool, because you'd like a Pajero but can't afford it.
VW
You are an exciting and care-free individual. Friends are often
envious of you and your car. Although you are very good-looking
and attractive to the opposite sex, you are very modest and
down-to-earth. Your superior intelligence will get you far in this world.
You were born
to lead.
Toyota
You have an inferiority complex and feel threatened by VW drivers. You
are usually very bad in bed and have difficulty in impressing people of
the opposite sex. You are usually an embarrassment at social functions
and tend to stay alone at home. You find sexual gratification from sleazy
magazines and movies. Often you are found outside adult amusements
stores.
Your desire to own a VW sometimes overwhelms you, and you become nasty and
rude. You should jump into your TOYOTA and drive off a cliff.
====================
If a mouse fails to operate or should it perform erratically, it may need a ball replacement. Mouse balls
are now available as FRU (Field Replacement Units). Because of the delicate nature of this procedure,
replacement of
mouse balls should only be attempted by properly trained personnel.
Before proceeding, determine the type of mouse balls by examining the underside of the mouse.
Domestic balls will be larger and harder than foreign balls. Ball removal procedures differ depending
upon the manufacturer of the mouse. Foreign balls can be replaced using the pop-off method. Domestic
balls are replaced by using the twist-off method.
Mouse balls are not usually static-sensitive. However, excessive handling can result in sudden
discharge. Upon completion of ball replacement, the mouse may be used immediately. It is
recommended that each person have a pair of spare balls for maintaining optimum customer
satisfaction.
Any customer missing his balls should contact the local personnel in charge of removing and replacing
these necessary items.
====================
"You know "that look" women get when they want sex? Me neither."
~ Steve Martin
"Having sex is like playing bridge. If you don't have a good partner,
you'd better have a good hand."
~ Woody Allen
"Leaving sex to the feminists is like letting your dog vacation at the
taxidermist."
~Matt Barry
"Sex is one of the nine reasons for reincarnation. The other eight are
unimportant."
~George Burns
==============
A man comes home from an exhausting day at work, plops down on the couch in front of the television,
and tells his wife, "Get me a beer before it starts." The wife sighs and gets him a beer.
Fifteen minutes later, the man says, "Get me another beer before it starts." She looks cross, but fetches
another beer and slams it down next to him.
He finishes that beer and a few minutes later says, "Quick, get me another beer, it's going to start any
minute." The wife is furious. She yells at him, "Is that all you're going to do tonight? Drink beer and sit
in front of that TV? You're nothing but a lazy, drunken, fat slob, and furthermore..."
===================
On a tour of Scotland, the Pope took a couple of days off his itinerary to visit the North West coast on
an impromptu sightseeing trip. His 4X4 Pope mobile was driving along the golden sands when there
was an enormous commotion heard just off the headland. They rushed to see what it was and upon
approaching the scene the Pope noticed just outside the surf, a hapless man wearing a English Rugby
jersey, struggling frantically to free himself from the jaws of a twenty-foot shark. At that moment a
speedboat containing three men wearing Scottish rugby tops roared into view from around the point.
Spontaneously, one of the men took aim and fired a harpoon into the shark's ribs, immobilizing it
instantly.
The other two reached out and pulled the Englishman from the water and then, using long clubs, beat
the shark to death. They bundled the bleeding, semi conscious man into the speedboat along with the
dead shark and then prepared for a hasty retreat, when they heard frantic shouting from the shore.
It was of course the Pope, and he summoned them to the beach. Upon them reaching the shore the
Pope went into raptures about the rescue and said, "I give you my blessing for your brave actions. I had
heard that there were some racist xenophobic people trying to divide Scotland and England, but now I
have seen with my own eyes this is not true. I can see that your society is a truly enlightened example of
racial harmony and could serve as a model on which other nations could follow."
He blessed them all and drove off in a cloud of dust. As he departed, the harpoonist asked the others,
"Who was that?"
"That," one answered, "was his Holiness the Pope. He is in direct contact with God and has access to all
God's wisdom."
-- - - - - - - -
"Well," the harpoonist replied, "he knows f--- all about shark hunting. How's that bait holding up or do
we need to get another one?"
======================
You can be shit faced, shit out of luck, or have shit for
brains. With a little effort, you can get your shit together,
You can smoke shit, buy shit, sell shit, lose shit, find shit,
forget shit, and tell others to eat shit and die. Some people
know their shit, while others can't tell the difference between
shit and Shinola.
There are lucky shits, dumb shits, crazy shits and sweet shits.
There is bull shit, horse shit and chicken shit. You can throw
shit, sling shit, catch shit, shoot the shit, or duck when shit
hits the fan.
You can give a shit or serve shit on a shingle. You can find
yourself in deep shit or be happier than a pig in shit. Some
days are colder than shit, some days are hotter than shit and
some days are just plain shitty.
Some music sounds like shit, things can look like shit, and
there are times when you feel like shit. You can have too much
shit, not enough shit, the right shit, the wrong shit or a lot
of weird shit.
When you stop to consider all the facts, it's the basic
building block of life. And remember, once you know your shit,
you don't need to know anything else.
=========================
A GIRLS PRAYER
Lord,
Amen.
************************************************
A BOYS PRAYER
Lord,
Amen.
***********************************************
The Pope meets the cardinals to discuss a proposal from Ariel Sharon, the leader of Israel.
"Your Holiness" says one of the cardinals, "Mr Sharon wants to challenge you to a game of golf to show
the friendship and ecumenical spirit shared by the Jewish and Catholic faiths."
The Pope thinks that this is a good idea but he's never held a golf club.
"Isn't there a cardinal that can represent me?" he asked.
"Yes there's a man named Jack Nicklaus, an American golfer who's a devout Catholic. We can offer to
make him a cardinal then ask him to play Ariel Sharon as your personal representative. In addition, to
show our spirit of cooperation, we'll also win the match."
Everyone agrees it's a great idea.
The call is made. Of course Nicklaus is honoured and agrees to play.
The day after the match Nicklaus reports to the Vatican to inform the Pope of the result.
"I don't like to brag but I played the best golf ever. I must have been inspired from above. My drives
were long and true, my irons accurate and my putting was perfect. In fact my play was truly
miraculous."
"So you won then?" the Pope asked.
Nicklaus sighs. " No, your Holiness. I lost to Rabbi Woods by three strokes."
===================
Compact and portable, it can be used anywhere - even sitting in an armchair by the fire - yet it is
powerful enough to hold as much information as a CD-ROM disc. Here's how it works...
Each BOOK is constructed of sequentially numbered sheets of paper (recyclable), each capable of
holding thousands of bits of information. These pages are locked together with a custom-fit device
called a binder which keeps the sheets in their correct sequence. Opaque Paper Technology (OPT)
allows manufacturers to use both sides of the sheet, doubling the information density and cutting costs
in half.
Experts are divided on the prospects for further increases in information density; for now BOOKs with
more information simply use more pages. This makes them thicker and harder to carry, and has drawn
some criticism from the mobile computing crowd.
Each sheet is scanned optically, registering information directly into your brain. A flick of the finger
takes you to the next sheet. The BOOK may be taken up at any time and used by merely opening it. The
BOOK never crashes and never needs rebooting, though like other display devices it can become
unusable if dropped overboard. The "browse" feature allows you to move instantly to any sheet, and
move forward or backward as you wish.
Many come with an "index" feature, which pinpoints the exact location of any selected information for
instant retrieval. An optional "BOOKmark" accessory allows you to open the BOOK to the exact place
you left it in a previous session -even if the BOOK has been closed. BOOKmarks fit universal design
standards; thus, a single BOOKmark can be used in BOOKs by various manufacturers. Conversely,
numerous BOOKmarks can be used in a single BOOK if the user wants to store numerous views at
once. T he number is limited only by the number of pages in the BOOK.
You can also make personal notes next to BOOK text entries with an optional programming tool, the
Portable Erasable Nib Cryptic Intercommunication Language Stylus (PENCILS).
Portable, durable, and affordable, the BOOK is being hailed as the entertainment wave of the future. The
BOOK's appeal seems so certain that thousands of content creators have committed to the platform.
Look for a flood of new titles soon.
==================
1: DOS Beer
You need to use your own can opener, and it requires you to read the directions carefully before
opening the can. Originally only came in an 8-oz. can, but now comes in 16-oz. can. However, the can is
2: Mac Beer
Initially came in only a 16-oz. can, but now comes in a 32-oz. can. Considered by many to be a "light"
beer. All the cans look identical. When you take one from the fridge, it opens itself. The ingredients list
is not on the can. If you call to ask about the ingredients, you are told that "you don't need to know." A
notice on the side reminds you to drag your empties to the trashcan.
4: Windows 95 Beer
Looks a lot like Mac Beer's can, but tastes more like Windows 3.1 Beer. It comes in 32-oz. cans, but
when you look inside, the cans only have 16 oz. of beer in them. Most people kept drinking Windows 3.1
Beer until their friends tried Windows 95 Beer and said they liked it. The ingredients list, when you look
at the small print, has some of the same ingredients that come in DOS beer, even though the
manufacturer claimed it was an entirely new brew.
Windows NT Beer
Comes in 32-oz. cans, but you can only buy it by the truckload. This causes most people to have to go
out and buy bigger fridges. The can looks just like Windows 3.1 Beer's, but then the company promised
to change the can to look just like Windows 95 Beer's. Touted as an "industrial strength" beer, and
suggested only for use in bars.
Unix Beer
Comes in several different brands, in cans ranging from 8 oz. to 64 oz. Drinkers of Unix Beer display
fierce brand loyalty, even though they claim that all the different brands taste almost identical.
Sometimes the pop-tops break off when you try to open them, so you have to have your own can opener
around for those occasions, in which case you either need a complete set of instructions, or a friend
who has been drinking Unix Beer for several years.
--------------------------------------------------------------------------------
1: DOS Airlines
Passengers are handed maps, compasses, rulers, pencils, and an airplane manual (shrink- wrapped) as
they enter the plane. They have to figure out how to get the plane to wherever they want to go. Some
succeed very well. Others crash, but they shouldn't have been messing around with airplanes anyway.
2: Maclntosh Airlines
All the stewards, stewardesses, captains, baggage handlers, and ticket agents look the same, act the
same, and talk the same. Every time you ask questions about details, you are told you don't need to
know, don't want to know, and everything will be done for you without you having to know, so just shut
up.
3: OS/2 Airlines
If you succeed in getting on board the plane and the plane succeeds getting off the ground, you have a
wonderful trip ...
4: Windows Airlines
The airport terminal is nice and colorful, with friendly stewards and stewardesses, easy access to the
plane, and an uneventful takeoff... then the plane blows up without any warning whatsoever.
5: NT Airlines
Everyone marches out on the runway, says the password in unison, and forms the outline of a plane.
Then they all sit down and make a whooshing sound like they're flying.
6: UNIX Airlines
Everyone brings one piece of the plane with them when they come to the airport. They all go out on the
runway and put the plane together piece by piece, arguing constantly about what kind of plane they are
building.
==================
I went to the store the other day, I was only in there for about 5 minutes and when I came out there was
a copper writing a parking ticket.
So I went up to him and said, 'Come on man, how about giving a guy a break?'
He glared at me and started writing another ticket for having bald tyres!!
He finished the second ticket and put it on the car with the first.
This went on for about 20 minutes, the more I abused him, the more tickets
he wrote.
=====================
A blonde, wanting to earn some money, decided to hire herself out as a handy-woman' and started
canvassing a nearby well- to-do neighborhood. She went to the front door of the first house, and asked
the owner if he had any odd jobs for her to do.
"Well, you can paint my porch," he said, "How much will you charge me?"
The blonde, after looking about, responded, "How about $50?"
The man agreed and told her that the paint and other materials that she might need were in the garage.
The man's wife, inside the house, heard
the conversation and said to her husband, "Does she realize that the porch goes all the way around the
house?"
A short time later, the blonde came to the door to collect her money.
"You're finished already?" the husband asked.
"Yes," the blonde replied, "and I had paint left over, so I gave it two coats."
Impressed, the man reached into his pocket for the $50.00 and handed it to her.
"And by the way," the blonde added, "it's not a Porch, it's a BMW."
=============
Two Blonde woman were in the woods hunting. One looked at the other and said, "I've got to take a
sh*t."
The other said, "Well go behind one of those big trees, and sh*t."
The first one said, "But I don't have any paper to wipe my ass." The other blonde replied, "You have a
dollar, don't you?"
The first one said, "Yeah, I've got a dollar. That's a great idea- I'll use that!"
She left and came back with sh*t all over her hands and clothes.
Her friend looked at her and asked, "What in the hell happened to you?"
The first one replied, "Have you ever tried to wipe your ass with 3
quarters, 2 dimes, and a nickel?"
============
Duncan the humble crab and Kate the Lobster Princess were madly, deeply, and passionately in love.
For months they enjoyed an idyllic relationship, until one day Kate scuttled over to Duncan in tears.
"We can't see each other anymore....." she sobbed.
"Why?" gasped Duncan.
"Daddy says that crabs are too common" she wailed. "He claims you are a mere crab, and a poor one at
that, and crabs are the lowest class of crustacean...and that no daughter of his will marry someone who
can only walk sideways."
Duncan was shattered, and scuttled sideward away into the darkness and to drink himself into a filthy
state of aquatic oblivion.
That night, the great Lobster ball was taking place. Lobsters came from far and wide, dancing and merry
making, but the Lobster Princess refused to join in, choosing instead to sit by her fathers side,
inconsolable.
Suddenly the doors burst open, and Duncan the crab strode in.
The Lobsters all stopped their dancing, the Princess gasped, and the King Lobster arose from his
throne. Slowly, painstakingly, Duncan the crab made his way across the floor...and all could see that he
was walking ... not sideways, but FORWARDS, one claw after another!
Step by step he made his approach towards the throne, until he finally looked the King Lobster in the
eye.
Submit
Subscribe Unsubscribe
Powered by YourMailinglistProvider.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
"Utter Rubbish"
Page V
Between the ages of 30 - 35, she is like India or Spain. Very hot,
relaxed and convinced of its own beauty.
After a woman gave birth to her baby, the Doctor stood solemnly beside her bed.
“There is something I must tell you about your baby.”
"What’s wrong”, the alarmed mother asked?
“Your baby is a hermaphrodite.”
“What’s that?”
“It means your baby has both male and female parts.”
“Oh my God, that’s wonderful!”, the mother said, “You mean it has a penis and a brain?”
"Knock Knock"
"Who's there?"
"Me, can I come in?"
"Sorry, we're closed".
Cannibal Jokes
Two cannibals are eating a clown. One says to the other, "Does this
taste funny to you?"
That reminds me of the cannibal that passed his friend in the woods.....
Have you heard about the cannibal restaurant? Dinner costs an arm and a
leg......
Did you hear about the cannibal who loved fast food? He ordered a
pizza with everybody on it.......
The first cannibal asked the 2nd cannibal, "Aren't you done eating
yet?" The 2nd cannibal replied, "I'm on my last leg now."
While on his state visit to England, George Bush met The Queen, and he
turns round and says: "As I'm the President, I'm thinking of changing
how my great country is referred to, and I'm thinking that it should
be be a Kingdom."
The Queen replies "I'm sorry Mr Bush, but to be a Kingdom, you have to
have a King in charge - and you're not a King."
George Bush thought a while and then said: "How about a Principality
then?"
Bush thought long and hard and came up with "How about an Empire then?
The Queen, getting a little annoyed by now, replies "Sorry again, Mr
Bush, but to be an Empire you must have an Emperor in charge - and you
are not an Emperor."
Before George Bush could utter another word, The Queen said: "I think
you're doing quite nicely as a Country."
Proudly showing off his new apartment to a couple of his friends late one night,
Kenny led the way to his bedroom where there was a brass gong.
"What's that big brass gong for?" one of the guests asked.
(burping) "Yup."
"Hmmm (hic)." "How's it work?" the second guest asked, squinting at it.
Over 15,000 men found themselves talking to the Atlanta Humane Society
about an 8-week old black Labrador retriever.
A man met a beautiful girl and she agreed to spend the night with
him for $500.00.
So they spent the night together. In the morning, before he left, he
told the girl that he did not have any cash with him, but that he would
have his secretary write a check and mail it to her, calling the payment "Rent
for Apartment." On the way to the office, he regretted what he had done,
realizing that the whole event was not worth the price.
So, he sent a cheque for $250.00 and enclosed a note :
Dear Madam:
Enclosed find a check in the amount of $250.00 for rent of your
apartment. I am not sending the amount agreed upon because when I rented the
apartment, I was under the impression that :
Upon receipt of the note, the girl immediately sent back the following reply:
Dear Sir:
First of all, I cannot understand how you expect such a beautiful
apartment to remain unoccupied indefinitely. As for the heat, there is
plenty of it if you know how to turn it on. Regarding the space, the
apartment is indeed of regular size, but if you don't have enough
furniture to fill it, please don't blame the landlord. I will expect full
payment due immediately or I will be forced to hire someone to remove your
furniture.
Q. What is a Yankee?
A. The same as a quickie, but a guy can do it alone.
Q: If the dove is the bird of peace, what is the bird of true love?
A.The swallow.
Q. Why do most women pay more attention to their appearance than Improving their minds?
A. Because most men are stupid but few are blind.
Q. Why do women rub their eyes when they get up in the morning?
A. They don't have balls to scratch.
SISTERS OF ST.FRANCIS
HOUSE OF PROSTITUTION
NEXT RIGHT
His curiosity gets the best of him and he pulls into the drive....On the
He climbs the steps and rings the bell....The door is answered by a nun
in a long black habit who asks, "What may we do for you, my son?"....He
answers, "I saw your signs along the highway, and was interested in
possibly
doing business.".....
"Very well, my son. Please follow me." ....He is led through many
winding passages and is soon quite disoriented....The nun stops at a
closed door and tells the man, Please knock on this door".............
He gets $100 out of his wallet and places it in the second nuns cup.....
He trots eagerly down the hall and slips throught the door, pulling it
shut behind him........
As the door locks behind him, he finds himself back in the parking lot,
facing another small sign:
GO IN PEACE.
YOU HAVE JUST BEEN
SCREWED BY THE
SISTERS OF ST. FRANCIS.
SERVES YOU RIGHT,
YOU SINNER.
Suddenly she sneezes, and her glass eye comes flying out of its
socket towards the man. He reflexively reaches out, grabs it out of
the air, and hands it back.
"Oh, my, I am so sorry," the woman says as she pops her eye back in
place. "Let me buy your dinner to make it up to you."
The next morning, she cooks a gourmet meal with all the trimmings.
The guy is amazed!! Everything had been SO incredible!!!!
"You know," he says, "you are the perfect woman. Are you this nice to
............
A woman was being sent to England to attend a two-week company training session.
Her husband drives her to the airport and wishes her to have a good trip.
The wife says, "Thank you honey, what would you like me to bring for you?"
The woman keeps quiet and bids him a loving good-bye hug and kiss.
Two weeks later husband came to collect her at the airport and asked,
"Honey, how was your trip?"
He winks and replies, "Remember what I asked for.... The English girl?"
One day a guy died and found himself in hell. As he was wallowing in
despair, he had his first meeting with a demon.
"Hell's not so bad," the demon said. "We actually have a lot of fun
down here. You a drinking man?"
"Sure," the man said, "I love to drink."
"Well you're gonna love Mondays then. On Mondays all we do is drink.
Whiskey, tequila, Guinness, wine coolers, diet Tab and Fresca. We
drink till we throw up and then we drink some more!"
The guy is astounded. "Damn, that sounds great."
"You a smoker?" the demon asked.
"You better believe it!"
"You're gonna love Tuesdays. We get the finest cigars from all over
the world and smoke our lungs out. If you get cancer, no biggie. You're
already dead, remember?"
"Wow, the guy said, "that's awesome!"
The demon continued. "I bet you like to gamble."
"Why yes, as a matter of fact I do."
"Wednesdays you can gamble all you want. Craps, blackjack, roulette,
poker, slots, whatever. If you go bankrupt, well, you're dead anyhow. You
into drugs?"
The guy said, "Are you kidding? I love drugs! You don't mean . . ."
"That's right! Thursday is drug day. Help yourself to a great big bowl
of crack, or smack. Smoke a doobie the size of a submarine. You can do
all the drugs you want, you're dead, who cares!"
"Wow," the guy said, starting to feel better about his situation, "I
never realized Hell was such a cool place!"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Aussie Sayings
I’M HUNGRY
"I could eat the crotch out of a dead leper's undies."
"So hungry I'd eat a shit sandwich, only I don't like bread."
"I could eat the arse out of a rag doll through a cane chair."
"So hungry I could eat the arse out of a low flying duck."
I'M THIRSTY
VOMIT
YES
"Does a Koala shit in a gum tree and wipe his ass on a Cockatoo?"
"Bloody oath!"
NO
"Pig's arse!!"
"Get Fucked!"
"I hope your ears turn into arseholes and shit on your shoulders."
"May your chooks turn into emus and kick your dunny down."
"So stupid that he wouldn't know a tram was up him 'til the bell rang!"
"If I had a dog that looked like him, I'd shave it's arse and make it walk backwards."
"She's been hit with the fugley stick too many times."
"He thinks his shit don' stink, but his farts give him away."
"Fell out of the ugly tree, and hit every branch on the way down."
COMPLIMENTS
ASSORTED
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
3. Type a color:
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-01
=========================
Wednesday 7th January 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
I am lost.
I have gone to look for myself.
If I get back, before I return,
please tell me to wait.
=========================
Evening All and a Happy New Year to You and all Your Families.
I had a nice break. Lot's of beer, some good food and some more beer.
I've decided to start afresh this year, so all last years questions, topics,
discussions and arguments are now null and void.
So, if you've got something you'd like to discuss or complain about,
get those emails written and send them to yours truly.
Come on, hurry up I'm waiting.............!!!!!!
The AfraLisp Newsletter needs YOUR contributions.
============
Anyhow, John Walker was the head hauncho. If you want all the correct facts,
read "The Autodesk File" by John Walker. I had a copy that I lent to someone
who never returned it to me, but you can download an electronic copy from the
web at http://www.fourmilab.ch/autofile/ .
From 1984 I started using AutoCAD and kept phoning the guys from Autodesk to
find out how to use the AutoCAD. Typically I phoned Richard Handyside in the UK,
and Duff Kurland in the USA. It was a real battle and a tough learning curve.
Not only was CAD a new product but so was computers, and I was only a draftie
and had no knowledge of either. These guys from Autodesk soon realised that it
may be better to get me to explain to other potential users how to use AutoCAD,
rather than have this "flood" of enquiries from a distant place in Africa.
So Autodesk started referring others to me for advice. Not long afterwards I started
selling AutoCAD and dropped the idea of actually producing drawings for a living.
It was in about 1992 that it was announced that the founder of Autodesk,
John Walker, was going to visit us in South Africa. By that time my original
Autodesk dealership, Infosoft, had merged with two other dealerships,
TechnoCAD and CadArt, to form the largest AutoCAD Dealership in Africa,
namely AFRACAD. The AutoCAD User Group was meeting at our premises in
http://www.afralisp.com/newsletter/2004/2004-01.htm (2 of 12) [23/03/2005 05:48:17 p.m.]
AfraLisp Newsletter No 2004-01
Woodmead when John Walker paid us a visit. John addressed the user group
and the AutoCAD users were excited at the prospect of finally meeting their hero.
I took John to my office and showed him my original AutoCAD 360 kb 5 ¼" floppy
disks with metal labels. John was amused and told me to keep them as they were
collectors items.
A few days later all the Autodesk Dealers went out to dinner at Sandton Sun Hotel
with John Walker as our guest. It was good to get to know John, and what a super
guy he is. Unfortunately his good wife could not accompany him on his visit as she,
being an Archeologist, was on assignment in Egypt at the time.
It was not long after that that John took the decision to give up the Chairmanship of
Autodesk and leave the running of the company to others. It had grown enormously
and was by then listed on NASDAQ. Visit John Walker's site http://www.fourmilab.ch
Oh, Kenny - Would you like my original 5 ¼" floppy AutoCAD disks to auction off to
the highest bidder and use to fund your site?
If so I will try & find them for you. They may be good for beer money at least!!
Pearls of Wisdom
===============
I'm a little teapot short and stout,
here is my handle,
here is my...other handle?
Sh*t, I'm a sugar bowl!!
===============
Coding
=======
Thanks a lot your website and especially for the pages there regarding making resource
DLL files for menu icons: http://www.afralisp.com/vbaa/vba15.htm and
http://www.afralisp.com/vbaa/vbadll.htm. I've been searching for a way to eliminate
the smiley faces from my custom toolbars for some time. As I read thru the information
you provided, one thought kept coming up in my mind: "this has got to be a major pain
to do for anything more than just a few icons". I did a bit more research and discovered
an alterative way of doing things that saves you from the trouble of adding and renaming
the bitmaps one by one as you add them.
You do need Visual Basic for this technique.
http://www.afralisp.com/newsletter/2004/2004-01.htm (3 of 12) [23/03/2005 05:48:17 p.m.]
AfraLisp Newsletter No 2004-01
where the 1st item is the name of the bitmap as referenced in the MNU file, and the
last item is the name of the file. Note that the MNU reference does not need to be the
same as the file name, although you probably want to keep them the same for
organizational purposes. I'm not sure what the rules are for naming the bitmaps in
the MNU file, but I've had problems if they have special characters like spaces or
punctuation characters.
This resource file should be a plain text file and saved as a *.RC file. Then run the
resource compiler on it like this:
RC resource.rc
This will generate a file resource.res. If it fails, you can use a /v switch and it will
print out the name of each bitmap as it processes it so you can see where it fails.
After you have a resource file generated, follow the instructions on your original page
(http://www.afralisp.com/vbaa/vba15.htm) except instead of adding the bitmaps one
by one, choose Project | Add New Resource File and select the *.RES file you just created
This adds them all in one single step and you are good to go.
Feel free to do whatever you want with with this (edit it, use it on your website or in
your newsletter or whatever). I just ask that if you put my name on it anywhere that
you don't put my e-mail address so it won't get harvested by spam-bots. I don't really
care if you credit me or not. Just consider it my way of giving you back a little for the
great service you provide on your website.
Tim Evans
=========
;Calculate area
(setq are 0)
(setq i 0)
(repeat (1- (length vert))
(setq are(+ are
(-
(* (car(nth(1+ i)vert)) (cadr(nth i vert)) )
(princ)
)
;CODING ENDS HERE
Erwin Hilb
=========
Kenny,
here is a fairly short VBA code snippet. We had a designer this week who was
having problems with drawing size 40+ Meg (normal for us, 700K or smaller).
This was after purging and cleaning out all of the anonymous blocks.
Eventually we found that he had tons of Text objects on his drawing with no
text in the value. One drawing had over 100,000 blank pieces of text (I
don't know how???).
Any how I ended up writing this code so he could "clean" his drawings on a
regular basis. The only problem we had with this code was when we tried it
on the 100,000+ text object drawing. Then we got an out of range error.
Add two command buttons to a form and copy this code into the code window.
(VBA)
Mode = acSelectionSetAll
txtcnt = 0
'select all text objects in drawing.
Randomize
Set ssetobj = ThisDrawing.SelectionSets.Add(Str(Rnd))
ssetobj.Select Mode, Point1, Point2, GroupCode, DataCode
ThisDrawing.PurgeAll
ThisDrawing.Application.Update
End Sub
Robert Kerbo
===========
http://www.afralisp.com/newsletter/2004/2004-01.htm (7 of 12) [23/03/2005 05:48:17 p.m.]
AfraLisp Newsletter No 2004-01
You know if I had as small a sense of humor as those folks who don't enjoy my joking at p
old Lisp's expense I might, in response to the "Ship High In Transit" joke respond with t
correct origin of that word.
The word sh*t entered modern English language derived from the Old English nouns scite
and the Middle Low German schite, both meaning "dung," and the Old English noun scitte,
meaning "diarrhea." Our most treasured cuss word has been with us a long time, showing
up in written works both as a noun and as a verb as far back as the 14th century.
Scite can trace its roots back to the proto-Germanic root skit-, which brought us the Ger
scheissen, Dutch schijten, Swedish skita, and Danish skide. Skit- comes from the Indo-Eur
root skheid- for "split, divide, separate," thus shit is distantly related to schism and
(If you're wondering what a verb root for the act of separating one thing from another wo
have to do with excrement, it was in the sense of the body's eliminating its waste --
"separating" from it, so to speak.
Optical Illusions:
http://www.indianchild.com/3d%20mainpage.htm
========
In the first quarter of 2004, CADzation will be releasing three new software programs
that will simplify the task of creating PDF and DWF files from a single suite of tools.
They are AcroPlot Pro, AcroPlot Matrix, and AcroPlot Auto. We are in final testing
of these products with selected CADzation customers and the results astounding.
Ever wanted to convert PLT, TIFF, CALS, and GP4 to PDF in a batch process?
AcroPlot Pro does it!
More--> http://www.cadzation.com/acroplotpro_info.htm
Ever need to open a PDF, reorder the pages, and insert a PLT or TIFF into it?
AcroPlot Matrix does it!
More--> http://www.cadzation.com/acroplotmatrix_info.htm
Looking for a way to convert 10,000 DWG's to PDF, make JPEG thumbnails,
and have it all post automatically to your web site? AcroPlot Auto does it!
More--> http://www.cadzation.com/acroplotauto_info.htm
DAY 766- Decapitated a mouse and brought them the headless body to make
them aware of what I am capable of, and to strike fear in their hearts. They
only cooed about what a good cat I was. Not working according to plan.
DAY 768- I am finally aware of how sadistic they are. For no reason I
was chosen for the water torture. This time it included a burning chemical
called "shampoo". What sick minds could invent such a liquid? My only
consolation is the piece of thumb still stuck between my teeth.
http://www.afralisp.com/newsletter/2004/2004-01.htm (10 of 12) [23/03/2005 05:48:17 p.m.]
AfraLisp Newsletter No 2004-01
DAY 774- I am convinced the other captives are flunkies and snitches.
The dog is routinely released and seems happy to return. He is obviously a
half-wit. The bird has got to be an informant, and speaks with them
regularly. I am certain he reports my every move. Due to his confinement
in the metal room, his safety is assured. But I can wait, it is only a
matter of time....
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If you can still hear the music, it's not loud enough!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-02
=========================
Tuesday 3rd February 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
The dumber people think you are,
the more surprised they'll be when you kill them!
=========================
Kenny,
I am a sailor in the South African Navy. My parents live in the suburb of
Constantia and one of my sisters, who lives in Paarl North, is married to an
I have recently become engaged to marry a former Thai prostitute who lives
in Sea Point and indeed is still a part time "working girl" in a brothel,
however, her time there is limited as she has recently been infected with an
STD. We intend to marry as soon as possible and are currently looking into
the possibility of opening our own brothel with my fiancée utilizing her
knowledge of the industry working as the manager. I am hoping my two sisters
would be interested in joining our team.
My problem is this: I love my fiancée and look forward to bringing her into
the family and of course I want to be totally honest with her. Should I
tell her about my brother-in-law being an Australian?
Pearls of Wisdom
===============
"I figured if I killed the first one, the word would get out."
- This is how I handled my teenage daughter's boyfriends.
===============
Coding
=======
Want a comfirmation box?
Usage :
==============
Kenny,
I wish you and all the other creatures staying at your place a Happy and
Healthy New Year.
Joop Moelee
============
Kenny,
I am using a script file to open and close a series drawings. The problem
is that some of the drawings may already be open and an extra line "Y" is
required in the script file to say "yes", open file as 'read-only'. The
problem is that the script file does not know ahead of time which files are
open. I may be able to work around this another way, but I was wondering
if there was a simple way of making a script file open all the required
drawings as 'read-only'? In his way the script file can be made the same
for all drawings even if they are open. (Is there a system variable that
can be set to force drawings to opened 'read-only'? It appears that there
may have been at one time, but these system variables have now been
removed.)
Regards
Craig Green
==========
Dear Kenny,
Victor Jammal
============
I can get the width and length of the arrow but not the angle.
thanks,
Kevin
=======
End Sub
'VBA CODE ENDS HERE
To locate other ActiveX functions that create objects, you need to look
in the AutoCAD ActiveX and VBA Reference. In Visual LISP, choose Help,
Visual LISP Help Topics. From the Contents tab, double-click ActiveX and
VBA Reference, and then Methods. You immediately see an alphabetical
list with the A’s displayed. Here are all the VBA methods that add drawing
objects. To create a Visual LISP function, add VLA- before the method.
For example, to add a circle, you would use VLA-AddCircle.
============
Business Opportunity :
http://www.vbdesign.net/expresso/showthread.php?s=&postid=162183#post162183
Spanish Forum :
http://www.vbdesign.net/expresso/forumdisplay.php?s=&forumid=18
Guest Questions :
http://www.vbdesign.net/expresso/forumdisplay.php?s=&forumid=59
Gr-Acad - Portugeus :
http://www.gr-acad.arq.br/
CADLandia - Italian :
http://www.cadlandia.com/
Intervision - Danish :
http://intervision.hjem.wanadoo.dk/
AutoLisp Exchange :
http://web2.iadfw.net/terrycad/
AutoLisp Tutorials:
http://www.geocities.com/johno_iom/autolisp.html
Hello,
I read your articles about making DLL’s and would like to publish them on the site
of the dutch AutoCAD Architectural Desktop 2004 user group (www.adtggnl.nl).
Of course I will name you and your site. Is this ok with you or do you have
any restrictions?
Thanks,
H. Bosma
NHOLLAND University
============
Hi, I have read with interest your letter about John Walker, is a piece of
history.
In it I found the name of Roberta Sandenburgh, I would like to send her kind
regards. I had the pleasure to meet her in the TTT seminar given by Autodesk
in Sausalito 1989.
At that time I was managing the Autocad Training Center at Israeli Institute
of Productivity.
Also I would like to congratulate you and your staff for the good material
you gave us ,and continue with a prolific year.
Jacob Levy.
==========
When creating a slide library using the SLIDELIB utility you create a text file
containing the names of the slide files. SLIDELIB can read a listing created
using DOS’s dir command with the /b parameter, which creates a simple listing
of just the file names. Therefore, you can place all the slide files in a folder and
redirect the dir listing to a file. For example, you can create a list named
afrasld.lst by typing the following at the DOS prompt: dir *.sld /b >afrasld.lst
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If you can still hear the music, it's not loud enough!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-03
=========================
Tuesday 10th February 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
I tried snorting coke the other day...
But I got an ice cube stuck in my nose.
=========================
Hey, I must tell you about this new restaurant I went to the other night.
Their claim to fame was that you could order anything you like and they
would provide it. Just to be difficult I ordered elephant testicles on toast.
The waiter took my order without any comment and disappeared, only
to return 10 minutes later to inform me that my order couldn't be filled as
they had ran out of toast.
Pearls of Wisdom
===============
I bet a lot of mimes choke to death because
nobody believes they are really choking.
===============
Coding
=======
Hello Kenny,
For your friends Victor Jamal, and Craig Green (see below) in MDI
Mode... To open drawings as Read only.
(vl-cmdf "vbastmt"
)
;CODING ENDS HERE
Peter Jamtgaard
==============
(vl-load-com)
http://www.afralisp.com/newsletter/2004/2004-03.htm (2 of 12) [23/03/2005 05:48:20 p.m.]
AfraLisp Newsletter No 2004-03
(if (vl-catch-all-error-p
(vl-catch-all-apply 'vla-item (list ssets "$Set")))
(progn
);progn
);if
(princ)
);defun
(princ)
;CODING ENDS HERE
=================
(vl-load-com)
(princ theurl)
(princ)
);defun
(princ)
;CODING ENDS HERE
==================
Hi Kenny,
Jim Fisher
=========
;;main function
Kenny,
I was trying to create a routine for autocad 2004 to allow me to draw a leader
by clicking on a toolbar button and draw the leader with no text.
I have tried to use the "leader" command along with three pauses for user
http://www.afralisp.com/newsletter/2004/2004-03.htm (6 of 12) [23/03/2005 05:48:20 p.m.]
AfraLisp Newsletter No 2004-03
input and the "" "" "n" for no text. For some reason the leader command
doesn't like the pauses. I also tried getting the user input first by
(setq pt1 (getpoint "First point:")) and then for the next two points.
Then I would put the pt1, pt2, pt3 in place where I had the pauses and it
works but I see it before it draws the leader. I click the first point and there
is no visual reference to that point and the next and the next.
I tried (getpoint'(1 1)) but that doesn't work.
How can I get this to work? All I want to do is push a tool button and
draw a 3 point leader with no text. After the third point I want it to end.
I can get the "dim" "leader" to work but I want the arrowhead to be part
of the leader.
Thanks,
Andreas A. Pilson
==============
Hi Kenny,
I am passing this on to you because it has definitely worked for me,
and at this time of year we all could use a little...calm!!!
By following the simple advice I read in an article,
I have finally found inner peace........the article read:
"The way to achieve inner peace is to finish all the things you've started."
So I looked around the house to see all the things I started and hadn't finished....
and before going to work this morning I finished off a bottle of red wine, a
bottle of white, the Bailey's, Kahlua and Tia Maria, my Prozac, some valium,
my cigarettes and a box of chocolates.
Regards,
Bill Storey
(In the cold north)
Dir$
===
One useful file function is the Dir$ function. This function works like the Dir
command at an MS-DOS command prompt. You can use the Dir$ function to retrieve
a list of one or more operating system files that match a file specification
or path. A path can include the name of a directory, a specific file name,
or both. For example, C:\*.DWG is the path to all the files in the root
directory of drive C having a DWG extension. The syntax of the Dir$ function
is as follows :
http://www.afralisp.com/newsletter/2004/2004-03.htm (8 of 12) [23/03/2005 05:48:20 p.m.]
AfraLisp Newsletter No 2004-03
stringvar = Dir$(path[,attributes])
Finding Files
===========
One use of the Dir$ function is to determine whether a file exists. If you
try to open a database or access a file that does not exist, an error occurs.
However, you can use Dir$ first to check for a files existence before opening
it, as in the following example :
The Dir$ function returns the filename without the full path if the specified
file is found, or it returns an empty string if no files were found.
The preceding line of code displays a message box if "MYFILE.DWG" does not
exist in the root directory of drive C. If the file does exist, the string
"myfile.dwg" is returned. To make things even simpler, you can create a generic
function that returns a Boolean value "True" if the given file exists.
This function could then be used to check any filename passed to the program
by the user, as in the following example :
sNextFile As String
sNextFile = Dir$("C:\DRAWINGS\*.DWG")
In the preceding example, notice that only the file path to Dir$ is supplied
on the first call. Each subsequent call to Dir$ has no arguments, indicating
that you want to use the previous file path and move to the next filename in
the list. When no more files match, Dir$ returns an empty string and the
"While" loop terminates.
Caution : When you use Dir$ in a loop, always exit the loop after an empty
string is returned. If you try to make another call to Dir$ with no arguments,
a runtime error occurs.
The second, optional parameter of the Dir$ function is used to provide additional
conditions (beyond the specified path) with which to select files. For example,
using the constant "vbDirectory" returns only the subdirectories (or folders)
http://www.afralisp.com/newsletter/2004/2004-03.htm (10 of 12) [23/03/2005 05:48:20 p.m.]
AfraLisp Newsletter No 2004-03
in the specified path. The constant "vbVolume" causes Dir$ to return the specified
drive's volume label. The available constants are summarized below :
Note : Constants can be added together if you want to use more than one.
For example, the following code finds the system, hidden and read only
file "IO.SYS" on a machine :
Note that the "vbHidden" constant refers to a file's attributes and not
the Windows Explorer option that hides certain file types.
==============================
(Second Part Next Week)
A blonde girl enters a store that sells curtains. She tells the salesman :
"I would like to buy a pink curtain in the size of my computer screen."
The surprised salesman replies :
"But, madam, computers do not have curtains...."
And the blonde said: "Helloooo.... I've got Windows!!!!!!!!!!!!!!!"
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Disclaimer :
Written by a highly caffeinated mammal.
---------------------------------------------------------
Did you miss a newsletter?
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-04
=========================
Tuesday 17th February 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
I think animal testing is a terrible idea.
They get all nervous and give the wrong answers.
=========================
Pearls of Wisdom
===============
"I thoroughly disapprove of duels. If someone should come up to me and
challenge me to a fight, I would take them kindly and forgivingly by hand,
lead them to a quiet place and kill them." - Mark Twain
===============
Copying Files
===========
The "FileCopy" command has the limitation that you cannot use wildcards to
specify multiple files. "FileCopy" can copy files locally or over a network,
as shown in the following example :
'The following lines of code use a network path for the source file :
Dim sDest As String
Dim sSource As String
sSource = "\\MYSERVER\DRAWINGS\TEST.DWG"
sDest = "C:\BACKUP\TEST-BACK.DWG"
Deleting Files
============
Visual Basic also allows you to delete files by using the "Kill" statement.
"Kill" can use wildcards to specify multiple files, as in the following
example :
Kill "D:\DRAWINGS\*.DWG"
Renaming Files
==============
The "Name" statement is like the MS-DOS "RENAME" command but can be used on
only one file at a time :
You can also use "Name" like the "MOVE" command in MS-DOS if the specified
paths are different :
In the preceding example, note the "MkDir" statement, which you have
probably guessed is used to create a new directory. The "MkDir" and "RemDir"
statements add and remove directories.
Performing deletes can be dangerous if you don't know the current directory.
Fortunately, Visual Basic offers a function that provides this value: the
"CurDir" function. The syntax of "CurDir" is :
stringvar = CurDir$([Drive])
Note - You can use the "Left$" function to get the current drive letter,
as in the following example :
sDriveLetter = Left$(CurDir$( ) , 1)
=============================
Option Explicit
Sub Backup()
Dim sSourceDir As String
Dim sBackDir As String
Dim sNextFile As String
On Error GoTo FileCopyError
'Change these paths to suit.
sSourceDir = "C:\DRAWINGS\"
sBackDir = "D:\BACKUP\"
sNextFile = Dir$(sSourceDir & "*.DWG")
While sNextFile <> ""
FileCopy sSourceDir & sNextFile, sBackDir & sNextFile
sNextFile = Dir$
http://www.afralisp.com/newsletter/2004/2004-04.htm (4 of 11) [23/03/2005 05:48:21 p.m.]
AfraLisp Newsletter No 2004-04
Wend
MsgBox "Drawing Backup Complete. Have a Nice Day."
Exit Sub
FileCopyError:
MsgBox "There was a problem copying the Drawings"
End
End Sub
Unfortunately, the following will only work in Visual Basic and not with VBA.
Do you fancy drawing something using Visual Basic?
Create a new project and add a new form.
Now copy and paste this coding :
Const PI = 3.14159
Const ARCSIZE = 45
Dim X As Integer, Y As Integer, R As Integer
Dim arcstart As Single, arcend As Single
Dim nCount As Integer
X = Me.ScaleWidth / 2
Y = Me.ScaleHeight / 2
R = X / 2
Me.DrawMode = vbCopyPen
Me.FillStyle = vbFSTransparent
Me.Circle (X, Y), R
Me.DrawMode = vbXorPen
Me.FillColor = vbBlue
Me.FillStyle = vbSolid
For nCount = 0 To 360
arcstart = nCount
arcend = nCount + ARCSIZE
If arcend > 360 Then arcend = arcend - 360
Me.Caption = "Arc of " & ARCSIZE & " degrees starting at " _
& nCount
http://www.afralisp.com/newsletter/2004/2004-04.htm (5 of 11) [23/03/2005 05:48:21 p.m.]
AfraLisp Newsletter No 2004-04
Circle (X, Y), R, , -acrstart * PI / 180, -arcend * PI / 180
DoEvents
Circle (X, Y), R, , -arcstart * PI / 180, -arcend * PI / 180
Next nCount
End Sub
'VB CODING ENDS HERE
=====================
Interesting Heh??
=====================
Coding
=======
This is the first time I email AfraLisp so let me start out by saying what a fantastic
web site it is. I've found so much useful information there.
Ok, now that I've buttered you up, I have a question. Is it possible to have a list
box or popup list box in DCL work similar to a combo box in VB(A). What I mean is,
I would like to be able to type in some text in a list box to add to the list.
Is that possible? If so, could you provide an example? If not, could you suggest
a workaround? Thanks again for an excellent web site,
Ron Baril
=========
Kenny
Question if i may
I'm running a VB program that opens autocad in batchplot function, ie opens
Autocad, Plots using predefined settings and then close's Autocad
and starts again.
My problem is that on the last Drawing file autocad stalls after plotting ie
it can't close out of autocad.
Is there away of closing autocad from VB..? or do i have to run the VB from
a Script which would have a Quit statement.
Regards
Aidan Mc Neice
=============
Hi Kenny,
Is it possible to run a Unix program from an Excel application using VBA?
I can do steps 1,2,4,5. If not possible, I will have to use Jscript(& not Excel).
Hi Kenny. I was reading this last newsletter and read a question about a
leader in 2004.
I have one that might work for them. Here it is. I have one for a 3
point leader and a 2 point leader.
Of course they can modify this to be there layer standard and such.
Thanks
Darek D. Watson
=============
Kenny,
I'm developing an application in Visual Basic 6.0 that will be installed on different
Windows operating systems. The application also references the Office object modules,
which I want to use to instantiate Word, Outlook and Excel. Visual Studio 6.0 has a
Package and Deployment Wizard, which creates an installation file containing all
the .ocx files etc. The problem I have is the fact that this package does not want to
install on platforms different than mine. The installation returns an error stating
that some files on the clients PC is outdated, and that they will be updated after a
reboot. This doesn't solve the problem though. How do I ensure that my application
is compatible with different setups than mine?
Colin Davies
===========
Kenny,
I was trying to create a routine for autocad 2004 to allow me to draw a
leader by clicking on a toolbar button and draw the leader with no text.
Simple answer:
Select your options for how you want your leaders to look.
Robert Endres
============
The RedHead :
A young redhead goes into the doctor's office and says that her body hurts
wherever she touches it.
Impossible," says the doctor. "Show me."
She takes her finger and pushes her elbow and screams in agony.
She pushes her knee and screams, pushes her ankle and screams.
Everywhere she touches makes her scream.
The doctor says, "You're not really a redhead, are you?"
"No," she says, "I'm actually a blonde."
"I thought so," the doctor says. "Your finger is broken".
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Disclaimer :
Written by a highly caffeinated mammal.
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-05
=========================
Tuesday 24th February 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
A chicken crossing the road is poultry in motion.
=========================
Pearls of Wisdom
===============
God does not play dice with the universe: He plays an ineffable game of His
http://www.afralisp.com/newsletter/2004/2004-05.htm (1 of 12) [23/03/2005 05:48:23 p.m.]
AfraLisp Newsletter No 2004-05
own devising, which might be compared, from the perspective of any of the
other players [i.e. everybody], to being involved in an obscure and complex
variant of poker in a pitch-dark room, with blank cards, for infinite stakes,
with a Dealer who won't tell you the rules, and who smiles all the time.
Terry Pratchett & Neil Gaiman, Good Omens
===============
Coding
=======
Error Trapping
=============
As you are writing your code, Visual Basic informs you of syntactical errors.
However, once the program is running, you may encounter unexpected
runtime errors in many circumstances.
For example, suppose you try to open a text file that the user has deleted.
When a compiled program has an error like this, an error message is
displayed and the program ends.
Although you cannot predict and write code for every possible type of error,
"File Not Found" errors are fairly easy to handle. If you do not write code to
work around the error, you can at least provide a message that makes more
sense before ending the program.
FileOpenError:
MsgBox "There was a problem opening the file. Stop for coffee!"
End
End Sub
In the preceding sample code, if the "Open" or "Line Input" statements cause
an error, the statements starting at the label "FileOpenError" are executed,
causing the message to be displayed and ending the program.
You should note a few points about the sample code. First, note the location
and style of the error handling routine. It is usually placed near the end of the
subroutine, with the label not indented to indicate a special section of code.
Second, and more important, note the "Exit Sub" statement after the "Open"
statement. It is necessary to prevent the error handler routine from executing
even when the "Open" statement was successful.
a) Exit the subroutine after informing the user of the error, and allow the program
to continue running with limited functionality.
c) Provide a way for the user to correct the error and retry the offending statement.
You can also have multiple labels within a procedure and set the current error handler
multiple times. For example, you can add a line to the code sample after the "Open"
statement that specifies a new label, "FileInputError". You can also turn off error
http://www.afralisp.com/newsletter/2004/2004-05.htm (3 of 12) [23/03/2005 05:48:23 p.m.]
AfraLisp Newsletter No 2004-05
handling with the following statement :
On Error Goto 0
The "On Error" statement goes hand in hand with the "Resume" statement. For example,
this statement causes errors to be ignored and the program to proceed through each line
of the code anyway :
You should use the preceding line of code sparingly because it really just ignores
errors rather than handles them. A better use of "Resume" is to go to another section
of code. as in the following example :
FileOpenError:
Dim sMessage As String
sMessage = "There was a problem opening the file. " & VbCrLf
sMessage = sMessage & "Press Retry to try again, or Cancel to quit."
End Sub
========
You can though use "On Error Resume Next" if you are trying to connect to AutoCAD
from an external Visual Basic or other application :
'open AutoCAD
Set acadApp = CreateObject("Autocad.Application.16")
'inform user
MsgBox Err.Description
'exit application
Exit Sub
End If
End If
=======
Next, set the document variable to the Document object in the AutoCAD
application. The Document object is returned by the ActiveDocument
property of the Application object.
From this point on, use the "ThisDrawing" variable to reference the
current AutoCAD drawing just like AutoCAD VBA.
If you know how to recover from certain errors that may occur, you can use these
objects to respond intelligently to a specific error. In one of the previous examples, yo
received a "File Not Found" error, which is number 53. You can easily add code
in the error handler to take appropriate action (that is, check another file) if the
value of "Err" is 53.
Hint : When you are writing an error handling routine with a message box,
display the error number and description in your message box to make
troubleshooting easier.
===================
Dear Kenny
Do you can me to help?
That is very important for me.
FormatDateTime(DateCreated,2)
I was wondering if you remember a couple of selection tools (in lisp I think)
called Freeze Entity & Thaw Entity? You could pick any number of entities &
it would put them on a layer called Freeze then freeze them. Thaw entity
would thaw them & return them to their original layers. You hade to be
careful because if you repeated freeze without thawing what was already
there they lost their original layer identity(s). The same would happen if you
left anything there when closing a drawing. I remember them from a few
years ago when using R14 & R15. I'm back using R15 because of where I'm
working & can't find them. They were actually pretty useful.
Want an AutoCAD Drawing Viewer that can read R2004 drawings and it's free??
http://www.infograph.com/products/dwgviewer/
Unfortunately, you cannot print or plot a drawing unless you pay.
Devious swine's..............
=======================================
1 vba tutorial
2 afralisp
3 AutoLISP
4 vba tutorials
5 LISP editor
http://www.afralisp.com/newsletter/2004/2004-05.htm (9 of 12) [23/03/2005 05:48:23 p.m.]
AfraLisp Newsletter No 2004-05
6 visual lisp
7 autocad 2002 express tools
8 toolbar.dll
9 autocad 2004 express tools
10 powerpoint vba
11 autocad tutorial
12 plt extension
13 AcCleanReg2004.exe
14 lisp tutorial
15 vba primer
16 express tools 2004
17 autocad express tools download
18 vba read text file
19 VBA
20 .PLT extension
===============
And from Lee Ambrosius
http://hyperpics.com/ :
1. At lunch time, sit in your parked car with sunglasses on and point
a hair dryer at passing cars. See if they slow down.
2. Page yourself over the intercom. Don't disguise your voice.
3. Every time someone asks you to do something, ask if they want fries
with that.
4. Put your garbage can on your desk and label it "IN".
http://www.afralisp.com/newsletter/2004/2004-05.htm (10 of 12) [23/03/2005 05:48:23 p.m.]
AfraLisp Newsletter No 2004-05
5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
over their caffeine
addictions, switch to espresso.
6. In the memo field of all your checks, write "for sexual favous".
7. Finish all your sentences with "in accordance with the prophesy".
8. Dont use any punctuation marks.
9. As often as possible, skip rather than walk.
10. Ask people what sex they are. Laugh hysterically after they answer.
11. Specify that your drive-through order is "to go".
12. Sing along at the opera.
13. Go to a poetry recital and ask why the poems don't rhyme.
14. Put mosquito netting around your work area. Play a tape of jungle sounds all day.
15. Five days in advance, tell your friends you can't attend their party because you're
not in the mood.
16. Have your coworkers address you by your wrestling name, Rock Hard Kim.
17. When the money comes out the ATM, scream "I won!", "I won!" "3rd time this week!!!!!"
18. When leaving the zoo, start running towards the parking lot, yelling run for your liv
they're loose!!"
19. Tell your children over dinner. "Due to the economy, we are going to have to let one
you go."
==========
1) How long did the Hundred Years War last? = 116 years
2) Which country makes Panama hats? = Ecuador
3) From which animal do we get cat gut? = Sheep and Horses
4) In which month do Russians celebrate the October Revolution? = November
5) What is a camel's hair brush made of? =Squirrel fur
6) The Canary Islands in the Pacific are named after what animal? =Dogs
7) What was King George VI's first name? = Albert
8) What color is a purple finch? = Crimson
9) Where are Chinese gooseberries from? = New Zealand
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-06
=========================
Tuesday 2nd March 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
If it weren't for physics and law enforcement,
I'd be unstoppable.
=========================
Pearls of Wisdom
===============
The History exam was a piece of cake -- which was a bit of a surprise
Hello!
This is really nothing more than an invitation.
To what?
CORBIMITE/VB Design's solution to the AUGI Guild/Forum problem!
I have created a set of forums that address ALL of the major issues
presented by current and ex-guild members (now moving over to
alternate resources) and I want to ask all of you to inspect what we
(Frank Zander & I) have built and to post/e-mail your opinions. comments,
and feedback. I really believe that this is the solution - it gives AUGI
a way to meet their obligations and Guild members a way to
post/track/reply via e-mail!
The site is located at:
http://www.acaduser.com
Everyone on this mailing list is welcome to register! Once you see it,
I'm certain that you will agree that this is the way to bring forums to
the Guilds and Web hosting to AUGI - Please feel free to post
comments/opinions in the forums - and, if you wonder about the use
of the AUGI title and graphics, They are fully aware of what we are doing!
Coding
=======
The following is published here with the kind permission of Lee Ambrosius :
http://hyperpics.com/
This example is used to demonstrate how you can replace the standard
functionality of the Double Click Editing inside of AutoCAD of your own
handler. This allows for changing the default editors and the way objects
are handled.
Module Code - All code should be placed in the class module called ThisDrawing.
http://www.afralisp.com/newsletter/2004/2004-06.htm (2 of 11) [23/03/2005 05:48:25 p.m.]
AfraLisp Newsletter No 2004-06
Option Explicit
If ssetObj.Count = 1 Then
PickPoint = ThisDrawing.Utility.TranslateCoordinates(PickPoint, acWorld, acUCS, False)
'' If the flag is true then Remote Text Express Tool is loaded
If bArxFlag = True Then
ThisDrawing.SendCommand "._Rtedit " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " E "
End If
ElseIf acadObj.ObjectName = "AcDbAttributeDefinition" Then ' Attribute not in block
Xref:
'' Xref can have or not have attributes
If exBlkObj.HasAttributes Then
'' Reference to enhanced Attribute editor - R2002 and 2004
If Left(ThisDrawing.GetVariable("ACADVER"), 5) = "15.06" Or Left(ThisDrawing.
GetVariable("ACADVER"), 3) = "16.0" Then
ssetObj.SelectAtPoint PickPoint
ThisDrawing.SendCommand "._Eattedit " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " "
Else '' Reference to old Attribute editor - R2000i
ssetObj.SelectAtPoint PickPoint
ThisDrawing.SendCommand "._Ddatte " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " "
End If
Else
Dim Msg As String
Dim Response As Integer
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Msg = "Do you want to open this Xref?" + vbCr + "Block Name: " + exBlkObj.Name + vbCr
GoTo EndBlock
NoXref:
'' Block can have or not have attributes
If blkObj.HasAttributes Then
'' Reference to enhanced Attribute editor - R2002 and 2004
If Left(ThisDrawing.GetVariable("ACADVER"), 5) = "15.06" Or Left(ThisDrawing.
GetVariable("ACADVER"), 4) = "16.0" Then
ssetObj.SelectAtPoint PickPoint
ThisDrawing.SendCommand "._Eattedit " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " "
Else '' Reference to old Attribute editor - R2000i
ssetObj.SelectAtPoint PickPoint
ThisDrawing.SendCommand "._Ddatte " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " "
End If
Else
ssetObj.SelectAtPoint PickPoint
ThisDrawing.SendCommand "._Refedit " & CStr(PickPoint(0)) & "," & CStr(PickPoint(1)) &
"," & CStr(PickPoint(2)) & " "
End If
EndBlock:
Else ' Other objects not handled above
ThisDrawing.SendCommand "'._properties "
End If
Next
ElseIf ssetObj.Count > 1 Then
ThisDrawing.SendCommand "'._properties "
End If
Kenny,
Our office has just swapped over to AutoCAD 2004. I was wondering if you or anyone
else knows of a good replacement for the old 'AutoCAD Today' feature which has been
removed in this new version.
I know must people didn't like it, but I found 'AutoCAD Today' absolutely invaluable
for keeping track of the many drawings in the many projects we work on. I really feel
lost without it and I am VERY upset that it has been removed. With 'AutoCAD Today'
I could quickly see all the drawings I worked on yesterday or several weeks before
- saves having to remember lots and lots of job and drawing numbers. Now all we
are left with is 9 of the previous drawings opened (big deal!) and you can't even
get a preview. I also found 'AutoCAD Today' very handy when filling out my time
sheet at the end of the week because 'AutoCAD Today' was able to show me all the
drawings I had been working on, on a day by day basis for the whole week.
Also, I was wondering if you or anyone else knows of a good replacement for the new
'ddedit' interface. I know the new interface has a lot of good features, but for straigh
forward text editing, I much prefer the old 2002 ddedit interface. I wish Autodesk had
provided a '-ddedit' command to bring up the old interface!
Regards
Craig Green
==========
Kenny,
' Use the "Object" variable to determine the type of object removed
MsgBox "The ID of the object deleted is: " & ObjectID
End Sub
George Binns
===========
YEP!!
Nieko Baisaus
============
Hi Kenny,
Good luck
Sherko
Amsterdam
mailto:[email protected]
=========================
Services include :
Tony Blair is being shown around a hospital. Toward the end of his
visit, he's shown into a ward populated by people with no obvious
signs of injury.
After greeting the first patient, the chap replies:
The third patient responds to the now thoroughly confused Prime Minister
thus:
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-07
=========================
Monday 8th March 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
If u cn rd ths u cn bcm a prgmr.
=========================
Hey Kenny!
Mike Tuersley
===========
Pearls of Wisdom
===============
If your parents didn't have any kids,
there's a good chance you won't.
===============
Coding
=======
;;; erzeugt oder löscht den DCenter-Wert für die übergebene Extension.
;;; Argumente:
;;; ERASEFLAG = nil oder T, wenn T wird die extension gelöscht, wenn nil erzeugt
;;; EXTENSION = Zeichenkette, definiert die zu berücksichtigende Dateierweiterung
;;; Prüfung auf Länge und "dw" Anfang
;;;
;;; Funktion legt in jedem Fall eine Backup-Extension der "dwg" als "..." an.
(defun MS:DC-SWITCH-EXTENSION (ERASEFLAG EXTENSION
/ ADCBACKUPKEY
ADCDWGKEY ADCEXTKEY
ADCKEY ADCTARGETKEY
CHANGED-EXT WRITE-BACKUP
)
(setq EXTENSION (strcase EXTENSION t))
(if (and (= (strlen EXTENSION) 3) (wcmatch EXTENSION "dw?"))
(progn
(if (setq ADCKEY (REG:ACADDCKEY))
(progn
(setq ADCEXTKEY (strcat ADCKEY "\\" "Extensions")
ADCTARGETKEY (strcat ADCEXTKEY "\\." EXTENSION)
ADCBACKUPKEY (strcat ADCEXTKEY "\\.zzz")
ADCDWGKEY (strcat ADCEXTKEY "\\.dwg")
) ;_ end of setq
;; Cleanup Backup-Pfad
(if (member ".zzz" (vl-registry-descendents ADCEXTKEY))
;_ existiert der Backup-Eintrag schon?
(if
(not (REG:TEST-LAYOUT-CLSID ADCBACKUPKEY))
http://www.afralisp.com/newsletter/2004/2004-07.htm (4 of 19) [23/03/2005 05:48:27 p.m.]
AfraLisp Newsletter No 2004-07
;_ existiert, aber keine Daten gesichert...
(setq WRITE-BACKUP t) ;_ erzeuge Backup
(setq WRITE-BACKUP NIL) ;_ Backup existiert schon
) ;_ end of if
(setq WRITE-BACKUP t) ;_ erzeuge Backup
) ;_ end of if
(if WRITE-BACKUP
(progn
(setq CHANGED-EXT
(REG:->KEY-LST-STRING-SUBST
"zzz"
"dwg"
(REG:->KEY-VALUE-LST ADCDWGKEY)
) ;_ end of REG:->KEY-LST-STRING-SUBST
) ;_ end of setq
(REG:WRITE-KEY-VALUE-LST CHANGED-EXT)
) ;_ end of progn
) ;_ end of if
(if ERASEFLAG
(if (REG:TEST-LAYOUT-CLSID ADCTARGETKEY)
(REG:DELETE-KEY-VALUE-LST
(REG:->KEY-VALUE-LST ADCTARGETKEY)
) ;_ end of REG:DELETE-KEY-VALUE-LST
) ;_ end of if
(REG:WRITE-KEY-VALUE-LST
(REG:->KEY-LST-STRING-SUBST
EXTENSION
"zzz"
(REG:->KEY-VALUE-LST ADCBACKUPKEY)
) ;_ end of REG:->KEY-LST-STRING-SUBST
) ;_ end of REG:WRITE-KEY-VALUE-LST
) ;_ end of if
) ;_ end of progn
) ;_ end of if
) ;_ end of progn
) ;_ end of if
) ;_ end of defun
;;; Liest den DesignCenter Key für die aktuell laufende AutoCAD-VErsion aus
(defun REG:ACADDCKEY (/ DCKEY retval)
(setq DCKEY "AutodeskApps\\AcadDC"
;_ Teilschlüssel zum ADC Eintrag von R2000 bis R2004 identisch
RETVAL (strcat (REG:WINBASEKEY) "\\" (vlax-product-key) "\\" DCKEY)
) ;_ end of setq
(if (not (vl-registry-descendents RETVAL))
(setq RETVAL NIL)
) ;_ end of if
retval
) ;_ end of defun
;;; Testet für einen übergebenen Key, ob es für den SubKey "Layouts",
;;; Wertname "CLSID" einen Wert gibt.
(defun REG:TEST-LAYOUT-CLSID (key /)
(vl-registry-read (strcat key "\\Layouts") "CLSID")
) ;_ end of defun
;;; Versuch einer Key-exist Funktion, leider geht es nicht... Mal schauen...
;;; Funktioniert nicht
(defun REG:KEYEXIST? (KEY VALUE / TEST-LST)
(if (setq TEST-LST (REG:REGSTR->KEY-VAL KEY))
(if (not (vl-catch-all-error-p
(vl-catch-all-apply 'vl-registry-descendents (list (car TEST-LST)))
) ;_ end of vl-catch-all-error-p
) ;_ end of not
(if (vl-registry-descendents (car TEST-LST))
KEY
) ;_ end of if
) ;_ end of if
Ciao,
Marc
=====
Dave McClure
============
http://www.flatmtn.com/cad/links-oldcad.html
Kind Regards,
Matthew Corbin
=============
Kenny,
Glad the thread was noteworthy. So you want to publish some LT info.
What are you looking for? Maybe some code for common tools. I know layer
utilities are always hot topics in the forums. Diesel was hard to get
used to, but it can add some robustness (is that a word?) to your very
dull LT system. Here are some layer functions you can create pretty
quickly by adding a new toolbar with some buttons and copy & paste the
code right into the macro section.
FreezeLayer
*^C^C_setenv;oldlayer;$m=$(getvar,clayer);_ai_molc;\"-layer;set;
$M=$(getenv,^M;oldlayer);freeze;$(getvar,clayer)";;LayerOff
*^C^C_setenv;clay1;$m=$(getvar,clayer);^P_ai_molc;\^P_setenv;
clay2;"$m=$(getvar,clayer)";_-layer;_off;"""$m=$(getenv,clay2);
_y;_s;$m=$(getenv,clay1);;;"""
LockLayer
*^C^C_setenv;oldlayer;$m=$(getvar,clayer);_ai_molc;\"_-layer;_s;
$M=$(getenv,oldlayer);_lock;$M=$(getvar,clayer)";;
Isolate ^C^C_ai_molc \-layer freeze * ;;;
UnlockAllLayer ^C^C-layer;_un;*;;
LayerOn ^C^C-layer _on *;;
ThawLayer ^C^C-layer;_t;*;;
Watch for word wrapping.These macros are quick and dirty. I'm afraid
it's about the best you can get when programming in Diesel.This worked
P.S. I once toyed with the thought of using VB with LT, but LT didn't
include the IDE. Maybe someone has had some luck going down that route.
===========================
Hi Kenny:
I had no idea you were looking for more code snippets. Frankly, they've
been my favourite part of the newsletter in the recent past, excepting
the new VBA code (please keep it coming, we VBA newbies need help!).
I've dug through my bag o' tricks to find something strange for you and
the rest of the folks.
I wrote this lisp routine after feeling the need to make quick blocks on
the fly. All you do is pick the entities and an insertion point. The
block is then made with a random name.
Cheers.
Kenny,
This is far easier to use. Pressing the F1 button gives you an excellent help.
Hope this is something you wanted?
Greetings,
H. Bosma
========
Dear Kenny,
Finding the top level xref's is done very fast with a selection set.
But is it possible to use selection sets inside an xref or block?
That may take a few minutes when there are many large
xrefs and blocks.
mvh,
Ragnar Thor Mikkelsen
www.designdata.no
=================
Hi,
What I want is to know that How i can stop those layers from
accidental purge.
Thanks
Gouhar
=======
Hi Kenny,
How is your employment situation?
I trust you have found something that is
(a) Better
(b) Stimulating
(c) Fun
(d) All the above.
Anyway, you were whining about me not contributing to your newsletter. Your
newsletter is the finest anywhere. It is my favorite. I know it doesn't need
my contributions.
So, having said that here is a contribution:
I found by accident that when you offer options in a command line prompt you
can get automatic cursor menu support.
For example if you start the circle command you see this at the command
prompt:
CIRCLE Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
If you right click in the drawing window while at this prompt and get a
cursor menu you will see "3P, 2P, and Ttr (tan tan radius)" as options that
you can select in that menu.
http://www.afralisp.com/newsletter/2004/2004-07.htm (14 of 19) [23/03/2005 05:48:27 p.m.]
AfraLisp Newsletter No 2004-07
So . . . if you've written a program that asks for user input at the command
prompt (and who hasn't) you can get the same functionality if you follow a
couple of rules.
1. Use square brackets to enclose your options.
2. Separate your options with a forward slash.
You'll see what I mean if you try the sample code below. Just copy it into a
regular module in AutoCAD VBA.
Run the program. You will get the prompt
Command: Do Something Really Great [New/Edit/Copy/Delete/Smeg] <New>:
At this point pop up your cursor menu. Usually that means hold down the
right mouse button.
You should see all of your options. Select one.
strDefault = "New"
strOptions = "New Edit Copy Delete Smeg"
ThisDrawing.Utility.InitializeUserInput 0, strOptions
On Error Resume Next
strOpt = ThisDrawing.Utility.GetKeyword( _
"Do Something Really Great [New/Edit/Copy/Delete/Smeg] <"
& _
strDefault & ">: ")
On Error GoTo 0
If strOpt = "" Then strOpt = strDefault
MsgBox "You selected the " & strOpt & " option." & vbCrLf & _
"You must be very proud.", vbOKOnly, "Command line options"
End Sub
' End of code
Joop Moelee
===========
Dear Sir,
Thanks in Advance
L.Gnanamuthu
=============
Mmmm, now that's a thought!
(Kenny runs off and fiddles with switches and does things.)
Guess what?
You can find all the AfraLisp Newsletters, in PDF format here :
http://www.afralisp.com/newsletter/newsletter.zip ( 828kb )
I have "misplaced" all the Newsletters prior to 2001. So if anyone still has
any of them, I would be delighted to have a copy.
The little boy replied, "Beer and women with big tits."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download all the AfraLisp Newsletters,
in PDF format here: http://www.afralisp.com/newsletter/newsletter.zip ( 828kb )
Issues 2001-01 to 2004-05
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-08
=========================
Sunday 14th March 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Visit "The CAD Vault" NOW....
http://www.cadvault.com/forums
=========================
Dead people are cool.
=========================
There have been, over the last decade, thousands of CADD related sites.
Some have specialized in programming, others in providing tools and tips,
and lately we have seen the introduction of forums - a place to gather and
discuss the problems that plague the industry or to share ideas. Many of
these sites have been restrictive, choosing to target their content at a
single platform, or limiting speech against a product, especially where
advertising or support dollars are involved or are the creation of the
company that sells the products being discussed.
All of that is about to change.
Introducing The CAD Vault, http://www.cadvault.com/forums
Using the best forum software available, CAD Vault (or just "The Vault")
will provide a common meeting place for all CADD disciplines, and (this is
the best part) it is being built to the specifications of the community.
Come visit The Vault today and help build a better community for tomorrow!
===============
Hi Kenny,
Mikes comment:
"They way I look at it, why email me for a problem that won't get an answer
for a month or two? Especially when you can go to a ng and get an answer in
a day. "
Mike Tuersley
Your response:
"Is Mike correct in what he says? What do you think?
Personally, I agree with him. But, would that not mean the demise of
Newsletter such as this? Not necessarily I say!"
My thoughts:
I agree with you in agreeing with him. The newsgroups have changed the niche
that newsletters or articles in magazines fill. True, if I want an answer to
a specific question I'll post it and hopefully get a reply that works and
quickly. This is especially true of the forums at vbDesign's Expresso.
The thing that is different about newsletters and/or magazines is that they
I don't think that newsgroups and newsletters are at odds. They each fill a
different need in the CADD community.
=Mark Johnston
===============
Pearls of Wisdom
===============
We all make mistakes... said the Dalek climbing off the dustbin.
===============
Coding
=======
In response to...
We are try to establish some CAD standards in our little office.......
... Our template has many layers also. In order to keep them from being
purged we draw a line and text on each layer out in the negative land
(left of 0,0), its very similar to a legend of layers. This gives users
a quick way of using match properties also, since all template layers
are shown.
Example:
Troy Gates
=========
Hi can you help me with a lisp program that will run a program to insert
spaces into a car park.
If so i would be extremely greatful.
Sean Noble
===========
Kenny
Some time ago I recall providing you with details of how I use
.x and .y filters in the POP0 section (shift right click) of the
acad.mns to allow me to draw lines to the x or y component of a
selected point.
Craig Green
And please take note of this statement towards the bottom of the page:
"Do you notice that this does not force the AutoCAD menu to recompile
but just adds and deletes from it on the fly."
============
Kenny,
Ever wonder why AutoCAD doesn't allow you to scale the X and Y axes
separately when using the SCALE command? Here is a solution that I devised
taking advantage of the fact that AutoCAD allows you X and Y scale a block.
The routine makes a block out of your selection set, inserts it to the X and
Y scales and then purges the block from the drawing. This routine can be
very handy sometimes.
Jeremy Dunn
===========
Kenny,
I have a question.
In Visual Lisp when you access the layers and a layer comes up as
bylayer for the linetype, and it is set to say continuous but is set to
bylayer how can I extract the information that tells us that it is set
to a continuous linetype but set to bylayer.
Can’t figure this one out and thought you could give me a hand
Tom Black
=========
We receive polyline artwork all the time where the arcs are actually
Ronny Liebregts
==============
Sub EmailSelection()
Dim MySS As AcadSelectionSet
Set MySS = ThisDrawing.SelectionSets.Add("ssMail")
ThisDrawing.Utility.Prompt vbCrLf & "Select entities to e-mail: "
MySS.SelectOnScreen
Dim mailbody As String
Dim FName As String
Dim MailFrom As String
Dim MailTo As String
FName = ThisDrawing.Utility.GetString(False, vbCrLf & _
"Enter a Drawing name.: ")
MailTo = ThisDrawing.Utility.GetString(False, vbCrLf & _
"Email To Address: ")
mailbody = ThisDrawing.Utility.GetString(True, vbCrLf & _
"Enter the text to the message: ")
ThisDrawing.Wblock "c:\" & FName, MySS
SendAsMail MailTo, mailbody, "The drawing you requested from me", _
"C:\" & FName & ".dwg"
Kill "c:\" & FName & ".dwg"
MySS.Delete
ThisDrawing.Utility.Prompt vbCrLf & "The file was sent"
End Sub
End Function
Hey Kenny, I need some help. I need program that will freeze a layer by
selecting an object.
Here's my problem:
* Wine her,
* Dine her,
* Hug her,
* Support her,
* Hold her,
* Surprise her,
* Compliment her,
* Smile at her,
* Listen to her,
* Laugh with her,
* Cry with her,
* Romance her,
* Encourage her,
* Believe in her,
* Pray with her,
* Pray for her,
* Cuddle with her,
* Shop with her,
* Give her jewellery,
* Buy her flowers,
* Hold her hand,
* Write love letters to her,
* Go to the end of the Earth and back again for her.
Insect Recipes
http://www.ent.iastate.edu/Misc/InsectsAsFood.html
Sub Reg_Read_Write()
Total = 3
Else
MsgBox "You still have " & Remain & " program runs left"
Ctr = Ctr + 1
End If
End Sub
I was rather impressed. I then noticed that there was a very thin
string hanging out of the waiter's fly.
Looking around, I noticed that all the waiters had the same string
hanging from their flies.
"How so?"
"See," he continued, "by tying this string to the tip of you know what,
we can pull it out over the urinal without touching it and that way
eliminate the need to wash our hands, shortening the time spent in the
restroom by 76.39 percent."
After you get it out, how do you put it back," I asked him.
"Well," he whispered, lowering his voice even further, "I don't know
about the others, but I use the spoon."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download all the AfraLisp Newsletters,
in PDF format here: http://www.afralisp.com/newsletter/news.zip
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-09
=========================
Tuesday 23rd March 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Visit "The CAD Vault" NOW....
http://www.cadvault.com/forums
=========================
All right. Who set the phasers to deep fat fry?
=========================
P.S. Just so you've all got ample warning, there will be a Newsletter next week,
but there is a possibility of a gap of a week or two due to the above issues.
=================
Pearls of Wisdom
===============
Maths and alcohol don't mix.
Don't drink and derive.
===============
Coding
=======
Kenny,
Just some feedback for you. Firstly your site is unmatched as a resource for
buddying programmers - I’ve learnt a lot from your site, so THANK YOU.
On one of your tutorials - “Standing Alone with Acad Install”, I think some
of your syntax may not be 100% correct. Where you use the following:
<InstallPath>
(spaces removed). I found using the syntax you had in your tutorial that
the pathing wouldn’t work from my INI file. Have you heard of this from
any other users? I found that only the latter syntax worked correctly.
Regards,
Chris Needham
http://cadmodz.com/
=================
Hi Rodney
As i was searching for autolisp routine to swap blocks and your routine
came up in afralisp newsletter.
Thanks,
John Dam
==========
Ron,
You have the solution already in your hand cq mouse.
When you are trimming or extending in your drawing you can select lines and
Joop Moelee
===========
Kenny,
Conclusion:
When you check for the absence of those entries you know if the line is
bylayer or bycolor or not.
Is this also true for “ltscla” and “lweight”?
All the other data you need can be found in the same way.
Let me know when you find out.
I have given you a good (I think) start for solving similar problems.
Break every problem down to as small parts as possible and start solving
these partial problems.
Joop Moelee
============
Hi Kenny
This is my first time i ever send you an email, but been reading your
newsletter for awhile now.
I got this simple lisp whick break a section of the line which run thru
another line at any angles,
The problem with this lisp is it doesn't works with polyline/lwpolyline
Could you please help to solve this problem.
(defun C:BREAKLINE ()
(setq var1 (getvar "osmode"))
(setq scale (getvar "dimscale"))
(setq brklen 2.5)
(setvar "osmode" 0)
(setq selc (entsel "\nSelect the line to be broken: "))
(setvar "osmode" 32)
(setq ptp (getpoint "\nSelect first point of intersection "))
(setvar "osmode" 0)
(setq ent1 (car selc))
(setq ent2 (entget ent1))
(setq Pt1 (cdr (assoc 10 ent2)))
(setq Pt2 (cdr (assoc 11 ent2)))
(setq angr (angle Pt1 Pt2))
(setq hi (* scale brklen))
(setq Pt3 (polar Ptp angr hi))
(setq Pt4 (polar Ptp (+ angr pi) hi))
(command ".break" ent1 Pt3 Pt4)
(setvar "osmode" var1)
(princ)
)
;;;Code end here;
Thanks,
John Dam
==========
Hi Kenny,
From your articles I made bitmap DLL's for Autocad menus
using the free resource hacker and they worked well until our office
got 2004 and windows XP. Now the icons don't show. Has the menu
structure changed or is it XP? Do you have a fix?
regards
Haris abd.
========
Anarchist Gallery
http://www.geocities.com/SoHo/Gallery/4168/
Free online AutoCAD 2000 tutorials are offered by myCADsite.com. The site
includes 39 lessons that will take a user from Step 1 to advanced 3D
concepts. The tutorials build on the previous and each one has a self-quiz
at the end. The site also includes links, drawing samples and some simple
Autolisp downloads. The latest addition is a review of AutoCAD 2005.
Thank you,
Large, loft apartments in New York City are plentiful and affordable,
even if the tenants are unemployed.
Should you decide to defuse a bomb, don't worry about which wire to cut.
You will always choose the right one.
It doesn't matter if you are greatly outnumbered in a fight involving martial arts.
Your enemies will wait patiently to attack you one by one... dancing around in
a threatening manner until you have dispatched their predecessors.
When you turn out the light to go to bed, everything in your bedroom will still be
clearly visible but slightly blue.
All beds have special L-shaped covers that reach up to the armpits of a woman
but only to the waist of the man lying beside her.
It's easy to land a plane, providing there is someone in the control tower to
talk you down.
Should you wish to pass yourself off as a German officer, it is not necessary to
speak the language. A German accent will do.
All bombs are fitted with electronic timing devices with large red readouts so you
know exactly when they're going to go off.
A police detective can only solve a case after he has been suspended from duty.
If you decide to start dancing in the street, everyone around you will be able to
mirror all the steps you come up with, and hear the music in your head.
Police departments give their officers personality tests to make sure each is
assigned a partner who is their total opposite.
When they are alone, all foreigners prefer to speak English to each other.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download all the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-10
=========================
Tuesday 29th March 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Visit "The CAD Vault" NOW....
http://www.cadvault.com/forums
=========================
Move your vowels every day or
you'll get consonated.
=========================
I'm sat in front of my PC writing this with removal men busy loading up the
truck.
Sorry, but I've got to sign off. I'll be back in about two weeks and this
time
from a new country and home. My email address will remain active for the
foreseeable future, but please don't expect any sort of reply for a few
days.
Pearls of Wisdom
===============
Don't use a big word where a diminutive one will suffice.
===============
Coding
=======
Kenny
Your readers who use 'Page setup names' when plotting may be interested in
this program.
Often we receive drawings from other offices, which contain page setup names
for their
printers. Or sometimes, I simply forget to define the page setups when I
first start one of
my own drawings. The program first deletes all the existing page setup
names in the
current drawing and then replaces them with the page setup names defined in
another
drawing. I chose, in this case, to hard code into the program the drawing
name containing
the required page setup names. For this reason, anyone using this program
must change
one line of the program to suit their own situation.
Green House
============
(defun C:BREAKLINE ()
(setvar "cmdecho" 0)
(setq PK1 (getvar "pickbox"))
(setvar "pickbox" 6)
(setq OM (getvar "osmode"))
(setvar "osmode" 32)
(setq AP1 (getvar "aperture"))
(setvar "aperture" 10)
(setq HILITE (getvar "highlight"))
(setvar "highlight" 1)
(while
(setq LN (entsel "\nChoose Line to Break .... "))
(setvar "osmode" 32)
(setq BKPT (getpoint "\nPick Break Intersection .... "))
(command "break" LN "f" BKPT "@")
(setvar "osmode" 0)
)
(setvar "osmode" OM)
(setvar "pickbox" PK1)
(setvar "aperture" AP1)
Bob Abernethy
=============
Kenny
Please find below two 'swap block' programs that I use that may be of
interest to John Dam. I wrote these programs over 10 years ago - they may
not be very elegant, but they do work. Note that no checking is done for
attributes.
The first is called: SB.lsp. The program first asks you to select the
blocks - pick as required or window large areas. Then you type in the name
of the block to be changed (or Enter for all blocks). Then type in the
name of the new block you want the old blocks to be changed too.
The second is called SBP.lsp. The program first asks you to select a block
which will be the NEW block. Then the select the blocks to change - pick
as required or window large areas. Then you type in the name of the block
to be changed (or Enter for all blocks).
Regards
Craig Green
==========
To Kenny,
How can I inport my standard dimension variables to another person's drawing
and override his dimension variables automatically?
I'm using Autocad 2002.
Also, while I have your attention, do you know if the graphic acceleration
software 'SoftEngine' Virbrant Graphic is still in existance?
Cheers, Kenny,
Great newsletter, this week. Eager to here the news, about the new gig.
Check out http://www.btlsp2000.com/cpstc.lsp, for a routine to straighten
lines, that vary slightly from the vertical or horizontal.
BT
===
Hi Kenny,
Thanks.
hear u on mail again soon.
Siraj Kazi.
==========
John,
As you write in the AfraLisp newsletter N0. 2004-9: polylines does not have
(assoc 10) and (assoc 11) but they do have "coordinates".
Because we are going to use ActiveX I will give you some of the code needed
because it is a bit complex to explain the finer points of the used
instructions in this newsletter.
If you need / want to know more about the used code and ActiveX look at the
tutorial page of the AfraLisp website for more info about ActiveX.
Those tutorials are really great and understandable.
Now “all” you have to do is implement this coding into your application.
Do not forget to put (vl-load-com) at the beginning of your routine to add
Arx capabilities, even before (defun C:--.
Last remark(s):
1) You have not declared any off the used variables in your
application.
It is (very) good practise to do so in order to forestall
interferences
from/with other applications.
For example „pt1“ and „ent1“ are variables that are so commen, that
everyone use them in every application they make.
2) You are using the AutoCAD command „scale“as a varriable.
Please do not do this but use for instance „MyDimScale“.
3) Using full written variables improve the readebility of the code.
Use „EndPoint“ instead of „pt2“.
Joop Moelee
===========
IMPROMPTU INTERVIEW
=====================
Lead singer
Guitar Player
Self-Trained Programmer
Webmaster
Husband
Father
Teacher to thousands.
Kenny has recently made some big changes in his work and personal life,
moving from
his position and home in Oranjemund to Cape Town, and this looked like the
perfect
opportunity (he's bound to be drunk from the farewell parties) to ask a
few pointed
questions about the past and future of both AfraLisp and my favorite band
in the sand,
BedRock...
o Q. When you created AfraLisp, did you have any idea of what you might be
getting
yourself into?
o Q. We know you are a Rock & Roll Man, but how did you get to be part of
the Band in the Sand?
A Stoep is the Afrikaans word for back or front porch. It's where all the
drinking, gossiping, kissing and serious business discussions take place.
=============
o Q. SPAM, it's flooding the inboxes of the world and making it harder for
people like you and I to reach our audiences using e-mail as a
delivery
system. Do you have any plans to change how you reach your readers, or
will we be seeing "Tara the noo" for many years to come?
o Q. Q.B.E.? You just made that up, didn't you? Admit it!
Randall Rath
===========
Ladies - If you accidentally over-salt a dish while it's still cooking, drop
in a peeled potato and it will absorb the excess salt for an instant
"fix-me-up."
Real Woman - If you over-salt a dish while you are cooking, that's too damn
bad. Please recite with me, The Real Women's motto: "I made it and you will
eat it and I don't care how bad it tastes."
Ladies - Cure for headaches: Take a lime, cut it in half and rub it on your
forehead. The throbbing will go away.
Real Woman - Take a lime; mix it with tequila, chill and drink. You might
still have the headache, but who cares?
Ladies - To keep potatoes from budding, place an apple in the bag with the
potatoes.
Real Woman - Buy boxed mashed potato mix and keep it in the pantry for up to
a year.
Ladies - When a cake recipe calls for flouring the baking pan, use a bit of
the dry cake mix instead and there won't be any white mess on the outside of
the cake.
Real Woman - Go to the bakery - they'll even decorate it for you.
Ladies - Brush some beaten egg white over pie crust before baking to yield a
beautiful glossy finish.
Real Woman - Woolies frozen pie directions do not include brushing egg
whites over the crust, so I just don't do it.
Ladies - If you have a problem opening jars, try using latex dishwashing
gloves. They give a non slip grip that makes opening jars asy.
Real Woman - Go ask the very cute neighbour to do it.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download all the AfraLisp Newsletters, in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-11
=========================
Monday 26th April 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
9 out of 10 men who try Camels prefer women.
=========================
It took a wee while to get on line due to communications problems that we all
live with here in Africa, but I didn't really mind as the break was rather nice.
Not much a letter this week as nobody seemed to want to write to me??
But, the doors are all open once again and I'm looking forward to a flood of
question, answers, jokes, etc, etc..........( Hint, hint ).
Oh, by the way, any readers out there from Cape Town?
If so, please drop me line or give me a buzz on 082-8304998.
It would be great to have a beer or ten together.
http://www.afralisp.com/newsletter/2004/2004-11.htm (1 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
Pearls of Wisdom
===============
Wine is sunlight, held together by water.
===============
Coding
=======
In trying to create some way of quickly checking for ADA and code
compliance in our building designs I have started placing the code into
our standard blocks. So our door block has several non-printing layers
that contain various dimensions, guidelines, and notes to assist the
user in meeting code. This generally works well until the block gets
mirrored rotated etc. and the text becomes unreadable.
Is there any way of placing text into a block in a way that will force
it to stay horizontal and non-mirrored? Or could I possibly write a
program that could search through a drawing and somehow?? fix the text
in the blocks that are messed up?
Thanks so much,
Zachary Kane
============
Dear Sir,
Currently i'm using Autocad 2004....
In this pkg...some new features is I can't explain....
I need your help....
How to create tool palettes file (extension is .xpt) ?
I want add lisp routine in tool palettes....
Your's,
Alpesh Upadhyay
http://www.afralisp.com/newsletter/2004/2004-11.htm (2 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
===============
Sending Code snippets to the forum for others to get benefits out is indeed
a generous act, but it would be nice that the code should be complete, bug
free or if their any bugs they must be highlighted.
In this regard, I shall point out the Lisp utility forwarded by :
BILL TONNESEN EMAIL >> [email protected]
;cpstc.LSP 040209 Square all lines
The following functions were used in the utility but was not included in
the code.
1) SVar .
2) mget .
3) prj
4) mag
5) dispn
6) (itzovr)
Regards,
UbaidUllah
==========
Hi there,
Thanks
Iain Johnson
===========
(defun c:archive ()
;define function
(setvar "HIGHLIGHT" 0)
;switch off highlight
(setvar "CMDECHO" 0)
;switch off command echo
(setvar "ATTDIA" 1)
;switch the dialogues back on
(setvar "HIGHLIGHT" 1)
;switch Highlight On
(setvar "CMDECHO" 1)
;switch Cmdecho On
(princ)
);defun
;=========================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "." mo "." yr)
);defun
(princ)
Userforms
=========
If you have programmed with AutoLisp and the Dialogue Control Language (DCL),
you will be familiar with designing dialogue boxes. Compared to DCL though,
designing dialogue boxes in VBA is a breeze. The basis of all dialogue boxes in
VBA is the Userform. This Tutorial will show you how to display and manipulate
Userforms.
A Userform is a container that holds all the controls such as labels, textboxes,
pictures, etc. that make up part of your applications interface.
A Userform has it's own Properties, Methods and Events. Let's have a look at some
http://www.afralisp.com/newsletter/2004/2004-11.htm (5 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
of them :
Displaying a Userform
==================
UserFormName.Show
So, to display a Userform named Userform1, you would use the following code:
Userform1.Show
If you want to, you can preload the Userform into memory without actually displaying it.
This can be useful as it can sometimes take a few seconds for a complex Userform to appea
The ability to preload the Userform allows you to decide when you would like this operati
to take place. To preload a Userform you would use the following code :
Load Userform1
Hiding/Unloading a Userform
========================
To temporarily hide a Userform, you would use the Hide method. This is a very good exampl
of how dialogue boxes in VBA are so much simpler than in AutoLisp. To hide a Userform you
would use the following code:
Userform1.Hide
Unload Userform1
Unload Me
Useform Events
=============
Userforms support many predefined events. Among the most commonly used events are
Initiliaze, Click and Terminate events.
http://www.afralisp.com/newsletter/2004/2004-11.htm (6 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
Note A VBA module that contains an event procedure can be called a module
'behind' the Userform. A module that contains event procedures is not visible in the Modu
collection of the Projects window of the VBA Editor. You must double-click the body of th
Userform to view the Userform Code Module.
Let's have a look at some Userform Events. Start your VBA Editor and insert a
Userform into a new Project. Double-Click the Userform and type in the following code:
End Sub
End Sub
End Sub
End Sub
End Sub
When you click the Userform the Click Event procedure is initiated and the Userform is
re-sized. Also, because you created a resize event procedure, you receive 2 message boxes
The resize event occurs twice because your code behind the click event changed both the
Width and Height properties of the Userform.
When you close the Userform, the QueryClose event procedure is triggered. This displays
a message box with the caption you gave the Userform in the code for the Initialize event
The QueryClose event is useful when you want to perform a certain set of actions when the
Userform is closed by the user.
The Terminate Event then triggers a message box which states that the Caption of the
Userform is Userform1. The Terminate Event occurs after the Userform is removed from memo
and the Caption of the Userform returns to it's original state.
========================
Some sorts of electricity do not use cables, like lightning and portable radios.
This kind of electricity is not generated but can be found in a draught.
A light switch is some sort of clamp that squeezes the wire so hard the electricity
is stopped. If one operates the switch, the pressure is released and the electricity
flows to the bulb.
A bulb is a piece of wire in which one can see the pure essence of electricity.
Normally the wire is isolated, however not in the bulb and that is why one can
see the electricity. The special spherical form acts as a magnifying glass to see
the electricity more clearly.
Light bulbs have a limited live span, because the heat turns the oxygen in the bulb
http://www.afralisp.com/newsletter/2004/2004-11.htm (9 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
into water. In time the water level in the bulb reaches the wire and the light bulb
goes out permanently.
Although the industry makes perfect good wires, i.e. wire netting, it is not allowed to
use them in an electrical installation. The electricity looses its heat to fast and the
electricity factory can do nothing with this used electricity.
Fuses are removable peaces of wire through which electricity flows after it is used
to cool down. Despite all technological innovation during the last time, it still is not
possible to make those pieces of wire thick enough, so they break down easily.
The industry expects to develop very soon a fuse that lasts longer.
If a computer or intelligent toaster suddenly quits the causes named in paragraph ten
may be the reason.
But with intelligent electricity it is possible that the electricity is not intelligent e
for the device in question.
That is why most computers and toasters also use standard electricity.
The knowledge acquired by the device enables it to upgrade the intelligence of normal
electricity.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
http://www.afralisp.com/newsletter/2004/2004-11.htm (10 of 11) [23/03/2005 05:48:34 p.m.]
AfraLisp Newsletter No 2004-11
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download all the AfraLisp Newsletters, in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-12
=========================
Monday 3rd May 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Visit the Expresso Cafe
http://www.vbdesign.net/expresso
=========================
Oh! Oh! Oh! - Dyslexic Santa.
=========================
Very busy last week and even busier this week. A BIG presentation tomorrow - more
on this at a later stage - and then I'm off back to Namibia on Wednesday. I've been invit
to Oranjemund by the General Manager of the company I used to work for.
It's his 50th birthday and he has requested my presence as he's booked BedRock
and of course, at this stage they are short of a lead guitarist/vocalist.
I can't complain, as I'm travelling there and back on the Citation AND I get paid
AND wined and dined whilst I'm there. All at their expense!!!
(All together now, "Happy Days are here again.............."
It's also a good opportunity to drum up some business for my new company.
(Ha, I'm devious hey?)
Pearls of Wisdom
===============
Hold a hard drive to your ear and listen to the C.
===============
Coding
=======
Given a list:
entering:
(match testlist 1)
will return:
(0 4 8 11 12 19)
Jeff Mishler
==========
Kenny,
Sounds like you are happy to be in Cape Town. Welcome back!
http://www.afralisp.com/newsletter/2004/2004-12.htm (2 of 13) [23/03/2005 05:48:36 p.m.]
AfraLisp Newsletter No 2004-12
Re UbaidUllah's request for a list of support routines to a primary routine,
"cpstc.lsp", latest edition, Afralisp, please refer him to the "fntn" series of
files at http://www.btlsp2000.com/page9.html.
Cheers, ...Bill
===========
Dear Kenny,
I’m trying to write an SSGET filter list that, among other things,
will filter all entities with a Z-Coordinate greater than 10 (say).
I’ve tried the help files and even checked out your “Selection
Sets” tutorial (which taught me how to start using them by the way)
but seem to be blind to the solution.
I’ve prayed before for insights and received them, but this one I’d
like to hand over to You. I know you’re not God, but (laughing) you
might be able to help me!?
Mark Leslie
==========
Do you know where I can find the Lisp routine that transfers mouse
selected entities from paper space to model space while retaining
the scale and vise versa?
Thanks,
Dennis C. Agabon
===============
Kenny
Good to hear you made it to Cape Town. Great to hear your job is working out OK.
Some of your readers may be interested in the attached program that is based on a
program I wrote more than 10 years ago now. The program called "setout.lsp" can be
used to layout blocks on architectural building plan drawings. The program inserts
blocks in rooms with the spacing between the blocks equal to twice the spacing between
the walls and the blocks. It can be used to help layout luminaires (light fittings),
http://www.afralisp.com/newsletter/2004/2004-12.htm (3 of 13) [23/03/2005 05:48:36 p.m.]
AfraLisp Newsletter No 2004-12
fire detectors, loud speakers etc. on electrical plans etc. If your readers are
interested, I could provide a version that 'locks' the blocks into the center of the
nearest ceiling tile and accommodates blocks with one attribute.
I have developed the core of this program into very useful automatic lighting and
fire detector design programs. The main restriction of this program is that the
rooms must be horizontal. However, I haven't found this to be too much of a problem.
Regards
Craig Green
Craig Green
===========
Sometimes you may need to store and retrieve information but do no need
the power of a spreadsheet or database. (not to mention the extra coding,
configuration and support files that go along with it.) In these cases a text
file may be just the thing you need. The process of storing and retrieving
information is simple, and the file can be edited by anyone - even if that
http://www.afralisp.com/newsletter/2004/2004-12.htm (7 of 13) [23/03/2005 05:48:36 p.m.]
AfraLisp Newsletter No 2004-12
person doesn't have a spreadsheet/database tool.
O.K. first let's create our text file. Open Notepad and enter these layer names :
Annotations
Architectural
Beers
Border
Civil
Dimensions
Electrical
Existing
Instrumentation
Mechanical
Piping
Steel
Text
Now save this file as Layer.txt, ensuring that it is within your support path.
Now open a new Project and Userform. Place a Listbox on the form keeping
the default name.
In the Userform Initialize event procedure, place the following code :
'clear listbox
ListBox1.Clear
http://www.afralisp.com/newsletter/2004/2004-12.htm (8 of 13) [23/03/2005 05:48:36 p.m.]
AfraLisp Newsletter No 2004-12
'loop
Wend
End Sub
In the preceding example, 1 is the file number. However, if you open and
close multiple files throughout your program, using this number might not
be a good idea. In that case, you should use the "FreeFile" function.
I've re-written the coding below to include this function as well as some
basic error trapping :
'loop
Wend
Exit Sub
err_handler:
End Sub
To write data, you open the file for sequential output or append.
Have a look at the following two lines of code, each of which opens
a file for output :
'output mode - always creates a new file, erases any existing information
Open "DwgLog.txt" for Output as #nFile
Have a look at the following coding that when you run it, will write a Log file
containing the date, time and Drawing Number :
'CODINGSTARTS HERE
Sub DrgLog ()
Exit Sub
err_handler:
End Sub
Every time the routine is run, the date, time and Drawing Number is added to the file.
(Hey, we could make a good drawing log file out of this?)
=============================
A blind man and his seeing eye dog are in the supermarket doing some shopping.
Suddenly in the middle of an aisle, the man picks up his dog by the tail and starts
swinging it around. A startled shop assistant rushes over and says to the man,
"What's the matter?" she yells, "Can I help you?"
The blind man continues swinging the dog and casually replies,
"No thanks, I'm just looking around."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download most of the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
The Expresso Cafe
http://www.vbdesign.net/expresso
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.afralisp.com/newsletter/2004/2004-12.htm (12 of 13) [23/03/2005 05:48:36 p.m.]
AfraLisp Newsletter No 2004-12
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-13
=========================
Tuesday 11th May 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
I am a nobody, and nobody is perfect;
therefore I am perfect.
=========================
Well another week has passed us by. Can you believe that it's already
the fifth month!!! It's nearly Christmas again, and I do believe that
it's time for a new AfraLisp Project. So, have you any ideas on what
shape or form this Project should consist of? I'll have a wee think
over the next week and I would like to ask you all to do the same.
It would be nice to have something that could include all the subscribers
of this Newsletter as it would bring us all together an emotional way,
and allow to get into each others deepest thoughts and desires.
(Hee, hee hee.....)
Pearls of Wisdom
===============
A grenade thrown into a kitchen in France would result in
Linoleum Blownapart.
===============
Coding
=======
Add them to the form along with a button control, retaining their
default names.
Now copy and paste the following code into the button's Click Event :
MAPISession1.SignOn
If MAPISession1.SessionID <> 0 Then
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose 'start a new message
.RecipDisplayName = "Kenny The Great"
'replace the following email address with your own
.RecipAddress = "[email protected]"
.MsgSubject = "Message To Kenny"
.MsgNoteText = "Hi Kenny"
.Send False 'don't display a dialog
End With
End If
mailerr:
MsgBox "Error " & Err.Description
End Sub
'CODING ENDS HERE
Hello, thanks for the great newsletters. I created a copy rotate command
that I think you would like to include in your newsletter
Here it is:
Bill.
===
Nothing is worse than accidentally triggering an option that takes a long time,
and then not being able to cancel it. It's no good having a Cancel button,
because no click event will fire until the loop is done.
The simplest way around this problem is to use DoEvents.
This command hands control back to Windows so that click events or other
actions can be processed before the loop continues.
Here's how to do it :
ii) For the button which starts the long process, add the following code :
CommandButton1.Enabled=False
CancelFlag=False
DoEvents
If CancelFlag then
Exit Sub
CommandButton1.Enabled=True
End If
CancelFlag=True
Note: If you use DoEvents, there is a possibility that the user may again
click the button which triggers the loop. You can prevent this by disabling
the button - CommandButton1.Enabled=False - or by setting a flag so that
the loop will not run again.
Google WOW
If you have not yet tried...
http://labs.google.com/personalized
Get on it!
========
Something Awful
http://www.somethingawful.com/
===========================
Fark.com
http://www.fark.com/
=================
Portal of Evil
http://www.portalofevil.com/
=======================
DodoCAD
========
Unable to fly and extinct for years.
There was a guy in a bar one night who got really drunk, I mean
really, really, really drunk. When the bar closed he got up to go home.
As he stumbled out the door he saw a nun walking on the sidewalk.
So he stumbled over to the nun and punched her in the face.
Shocked, the nun felt her knees go beneath her but before she could
do or say anything he punched her again.
This time she fell down and he stumbled over to her and kicked
her in the bum, then he picked her up and threw her into a wall.
By this time the nun was pretty weak and couldn't move very much.
Then he stumbled over to her, put his face right next to hers and
said................
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download most of the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-14
=========================
Monday 17th May 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Are you wearing your golfer's socks?
The pair with a hole in one.
=========================
Pearls of Wisdom
===============
All reports are in.
Life is now officially unfair.
===============
Coding
=======
Kenny,
This is far easier to use. Pressing the F1 button gives you an excellent help.
Hope this is something you wanted?
Greetings,
H. Bosma
========
Need some code? Here are useful quick keyins I like to use :
(graphscr)
(setq ss (ssget)
(princ)
(polar p1 ang d)
(defun C:ISO ()
(setvar "CMDECHO" 0)
(setvar "CMDECHO" 1)
(princ)
)
(princ)
;CODING ENDS HERE
Have fun.
Jeremy Dunn
===========
Well Kenny, you've moved to a new town and a new job and now I'll be
doing the same. After 15 years in the consulting engineering game, I'm
off to greener pastures. In two weeks I'll be leaving the relative
comfort of my life in Canada and moving to Taiwan to become an English
teacher! Thanks for all the coding tips and bad jokes over the years.
Good luck with your new job and continued success with Afralisp. It
really is the best thing out there. If I ever get back into CADding,
I'll know where to look.
I'll leave you with a few last bits of code. I hope someone may find
some use with them.
===============================================
;CODING STARTS HERE
;This is a quick trim program.
;Select 2 corners of an imaginary rectangle
;(preferably just outside the extents of the area you want trimmed)
;and the program takes care of the rest.
(defun c:TR (/ a b c d e f g h)
(terpri)
(setvar "cmdecho" 0)
(setq a (getpoint "First POINT of crossing: "))
(setq b (getpoint "Second POINT of crossing: "))
(setq c (car a))
(setq d (cdr b))
(setq e (cons c d))
(setq f (car b))
(princ)
)
(princ)
;CODING ENDS HERE
======================================
Cheers
=======================================
Hello Kenny,
I wrote this a few weeks ago, sorry I didn't send it sooner. I hope that
something is usefull.
I've been a fan of your web site for a couple of years now, excellent
information! You once answered a personal question of mine, so I will
return the favor to someone else:
I have considered writing a program to get around these bad side effects,
but it sounds hard and I am LAZY.
======================
Ok, here is a small programming question for all of you fat brained people
out there:
ENTSEL and NENTSEL are great commands that I use a lot, but I have some
issues with these commands.
First, there doesn't seem to be a way to distinguish between a bad pick (ie
I pick empty drawing space) and a user hitting the enter key at the prompt.
Both return nil. I have noticed that some AutoCAD commands can tell if I
make a bad pick instead of simply pressing enter. The only way that I can
think of doing this is to be able to quickly check the keyboard and see if
the enter key is still depressed a millisecond after the ENTSEL command is
finished. I have had no luck with GRREAD in this respect because it always
wants to pause for keyboard input. Is visual basic my only means of getting
around this one?
On a similar note, how can I check for shift or control (such as the express
tools extended offset command)?
Second, ENTSEL and NENTSEL have no way to allow for arbitrary input.
Sometimes I want a number to be entered or a choice from data that would
make an unweildy INITGET list (ie layer names).
I got this simple lisp whick break a section of the line which run thru
another line at any angles,
The problem with this lisp is it doesn't works with polyline/lwpolyline
Here is a handy lisp function that finds all of the intersecting points (as
a list of points) of a line between two points and a lwpolyline:
Jason Day
=========
Kenny,
In your latest afralisp email you asked people to send ideas for a
possible new project.
Well, here is a possible project. I am a lecturer at the INHolland
University in the Netherlands. I teach AutoCAD and all what comes
with it (VIZ and so on).
What I really should like to have is a tool to simply view a drawing
my students make and be able to print the results. The things that
should be detected is what blocks are used and on what layer they
are inserted. I’ve tried to make such a program myself but
I cannot find a way to detect a block with possible nested ones.
Also in the ‘investigation’
of the drawings should be the used styles for texts, dimensioning
and so on.
Do you like this project?
Hans Bosma
==========
Hi!
I'm a computer engineer here in Portugal. I have to interpret a
AutoCAD 2002 ASCII DXF file.I have printed Autodesk's own
description of the format. I've found it to be less than helpfull. :(
Have you ever seen a parser for such files written in a decent
manner? The ones i've seen only fit for a particular purpose.
I'm stuck on this. I would be greatly appreciated if you could
give me some pointers.
Thank you a lot.
Ricardo Ramalho
I'm the new guy - column reader, for about 2 months now.
I have a question on batch plotting - acad14.
The version is "Extended batchplot utility version 1"
Do you have Q.B.E. in this field, if so here is my question:
How can I change the default settings in the "plot area" tab
from "display" to "extents"?
When I open the batchplot and add 10 drawings, they are all
set to plot as "Display". I want to set it to "Extents" without having
to change this every time I open batchplot. It would be nice to have
it already set to "Extents" when I open batchplot.
P.S.
I've looked the web for an update - couldn't find it.
I begin to wonder if I am a troglodite working with stones & old tools?
Regards,
Scott Vanderstelt
==============
http://mirrored.flabber.nl/boob.cursor/ciagnijcycka.swf
Have Fun,
Jim Exler
========
http://www.shipoffools.com/Features/Curses/index.html
============================================
If:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z is represented as:
Then:
H-A-R-D-W-O-R-K
8+1+18+4+23+15+18+11 = 98%
and
K-N-O-W-L-E-D-G-E
11+14+15+23+12+5+4+7+5 = 96%
But,
A-T-T-I-T-U-D-E
1+20+20+9+20+21+4+5 = 100%
And,
B-U-L-L-S-H-I-T
2+21+12+12+19+8+9+20 = 103%
A-S-S-K-I-S-S-I-N-G
1+19+19+11+9+19+19+9+14+7 = 118%
So, one can then conclude with mathematical certainty that While Hard work
and Knowledge will get you close, and, Attitude will get you there, Bullshit
and Ass kissing will put you over the top.
Jim Exler
========
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download most of the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-15
=========================
Tuesday 25th May 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
He's dead Jim. Grab his tricorder. I'll get his wallet.
=========================
Pearls of Wisdom
===============
A midget fortune-teller who escapes from prison
is a small medium at large.
===============
Coding
=======
Both accomplish the same thing but the CUR+CUR method gives
the user more options. Of course it may take a few more clicks if
running OSnaps are off.
Give it a try and see what you think.
Thanks again for the great website,
Jeff Harris
=========
Kenny
How about a toolbox of handy functions and utilities. You know how you keep
going back to a set of lisps, etc and pulling code out of it because it is
useful. How about a set of those you have to have'em bits.
Keep up the fantastic work
Regards
Mark Bowes
==========
Try this:
Zac.
====
I think this would be a great idea, any input needed please call on me
Zain T Campbell
==============
Hi Kenny .
Just a few weeks ago I unveild the GEOMCAL to be use as a function on LISP
For me it is one of the most wonderfull tool to handle distances , and angle ,
mainly it handle angles in degree and can give the true angle between two lines.
learn it on the ACAD help
Maybe you can develop a tutorial on it
I do not understand about vector and it's use in CAL.
Hope it make sense
Gabriel
=======
Kenny,
I've been tweaking these two scripts for ages, but I think I've
finally refined them to the point where someone else might find them
useful. Using the functions and "mapped key" functions, it enables
"VV" to save the current view and layer state, and "V" to restore it.
http://www.afralisp.com/newsletter/2004/2004-15.htm (3 of 9) [23/03/2005 05:48:40 p.m.]
AfraLisp Newsletter No 2004-15
(defun ddc:quickview-restore()
; restore view and layerstate "_QuickView"
(if (tblsearch "VIEW" "_QuickView")
(command "-VIEW" "R" "_QuickView")
(princ "QuickView not found.")
)
(command "-LAYER" "A" "R" "_QuickView" "" "" "")
(princ)
)
(defun C:V() (ddc:quickview-restore))
(defun ddc:quickview-save()
; save current view and layerstate to "_QuickView"
; delete existing
(if (tblsearch "VIEW" "_QuickView")
(command "-VIEW" "D" "_QuickView")
)
(command "-VIEW" "S" "_QuickView")
; delete existing
(command "-LAYER" "A" "D" "_QuickView" "" "")
(command "-LAYER" "A" "S" "_QuickView" "" "" "")
; close the text window
(GRAPHSCR)
(princ)
)
(defun C:VV() (ddc:quickview-save))
Obviously this destroys the traditional "V" for VIEW, but that's
pretty easy to type by itself, and I since I use power tools to manage
layer states and use:
(defun C:ZZ()
; zoom 95% extents
(command "ZOOM" "E")
(command "ZOOM" "S" "95/100xp")
)
--
Steve Hall
=========
http://www.afralisp.com/newsletter/2004/2004-15.htm (4 of 9) [23/03/2005 05:48:40 p.m.]
AfraLisp Newsletter No 2004-15
Hi
I really need help with some autolisp project I have to make!
I need to make an entity (polyline) that it's composed by lines
and arcs and I cannot find the codes for the vertex for the arc
part of the polyline.
Prejbeanu Lucian
===============
Jason Day
You wrote:
I am LAZY
The good part is: When you make a bad choice the command won't be
terminated.
The bad part is: The command can only be terminated by making a choice or
by hitting the escape key.
So, if you use this as part of a lisp routine there is a chance that by
hitting the escape key your entire routine will be cancelled.
If so, you will have to adapt your error routine.
Joop
=====
Kenny,
Big fan of the Afralisp site, i dont work with many others whom have any 3D or
autolisp experience so if you have any thoughts on the following query id be very
http://www.afralisp.com/newsletter/2004/2004-15.htm (5 of 9) [23/03/2005 05:48:40 p.m.]
AfraLisp Newsletter No 2004-15
interested to hear it.
Ive documented a 3D piping drawing (lines only) and im using the 3d SW view to
view it as an isometric, however unable to think of any commands that will allow
me to automatically create gaps in lines in the appropriate places so lines to the
back are clear and not overlapping the lines in the front (if you get my drift). Ive
played with a lisp routine that will identify these cross over points however have
had no success.
The aparent intesection may hold some promise however the drawing has many
and im after a way of identifying them all with the touch of a button.
If youve got any thoughts or know of any programs that may be usefull, that would
be great.
Thanks
Ben
=====
Just don't read this someplace where your laughing will disturb others.
http://unbillablehours.typepad.com/unbillablehours/2004/05/when_the_world_.html
As hard as you try, you cannot piece together your return journey
from the pub to your house.
The answer to this puzzle is that you used a Beer Scooter.
The Beer Scooter is a mythical form
of transport, owned and leased to the drunk by Bacchus the Roman god of wine.
Bacchus has acquired a large batch of these magical devices.
The passenger reaches a certain level of drunkenness and the "slurring gland"
begins to give off a pheromone. Bacchus (or one of his many sub-contractors)
detects this pheromone and sends
down a winged Beer Scooter. The scooter scoops up the passenger and deposits
them in their bedroom via a Trans-Dimensional Portal. This is not cheap to run,
so a large portion of the passenger's in-pocket cash is taken as payment.
This answers the second question after a night
out "How did I spend so much money?"
Unfortunately, Beer Scooters have a poor safety record and are thought to be
responsible for over 90% of all UDI (Unidentified Drinking Injuries).
An undocumented feature of the beer scooter is the destruction of time segments
during the trip. The nature of Trans-dimensional Portals
dictates that time will be lost, seemingly unaccounted for.
This answers a third question after a night out "What the hell happened?".
With good intentions, Bacchus opted for the REMIT (Removal of Embarrassing
Moments In Time) add on, that automatically removes, in descending order,
those parts in time regretted most.
Unfortunately one person's REMIT is not necessarily the REMIT of another and
quite often lost time is regained in discussions over a period of time.
Independent studies have also shown that Beer Goggles often cause the scooter's
navigation system to malfunction thus sending the passenger to the wrong bedroom,
often with horrific consequences.
For the family man, Beer Scooters come equipped with flowers picked from other
people's garden and Thump-A-Lot boots (Patent Pending). These boots are
designed in such a way that no matter how quietly you tip-toe up the stairs,
you are sure to wake up your other half.
http://www.afralisp.com/newsletter/2004/2004-15.htm (7 of 9) [23/03/2005 05:48:40 p.m.]
AfraLisp Newsletter No 2004-15
Special anti-gravity springs ensure that you bump into every wall in the house
and the CTSGS (Coffee Table Seeking Guidance System) explains the bruised shins.
The final add-on Bacchus saw fit to invest in for some scooters is the
TAS (Tobacco Absorption System). This explains how one person can apparently
get through 260 Marlboro Lights in a single night.
PS: Don't forget the on-board heater, which allows you to comfortably get
home from the pub in sub-zero temperatures, wearing just a T-shirt.
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
You can also download most of the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-16
=========================
Tuesday 1st June 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Is it the twelveth of never YET?
=========================
The AfraLisp Books and the Newsletter Collections are now available as one
downloadable installation file.
http://www.afralisp.com/zip2/AfraLisp_Books.zip ( 5227 kb )
The ICAA members will consist of members who have contributed to the CAD
world through the means of tutorials, teaching or training on a non-profit basis.
Our motto will be "We Give Back".
Admission will be granted to those that contribute academically to the CAD world.
A small membership fee will be asked for to cover expenses, dis-encourage the wannabees,
and hopefully help to finance workshops, seminars, etc.
AfraLisp will host and administer, with the three volunteers as adjudicators.
Pearls of Wisdom
===============
How come when Star Trek boldly goes where no one has gone before,
there is always someone there?
===============
Coding
=======
(defun c:attcolor ()
(att-color-shift "test2" "0" 1 8)
;************************************************* **
; (att-color-shift "test2" "0" 1 8)
; as shown will get all block inserts named "test2" and change
; any red(1) attributes on layer "0" to color 8
(princ)
)
Jeff Mishler
===========
(defun AgainArcMan ()
(initget "Yes No")
(setq AskResume (getkword (strcat "\nUse last: "
http://www.afralisp.com/newsletter/2004/2004-16.htm (3 of 9) [23/03/2005 05:48:41 p.m.]
AfraLisp Newsletter No 2004-16
(rtos arc_length 2 8)
" No or <Y>es: "
)
)
); use old values?
(if (or (= AskResume "Yes") (= askresume nul))
(setq pt2 (osnap (getpoint "\nPick start of arc: ") "end,int,mid"))
(progn ; second progn
(setq pt1 (OSNAP (getpoint "\nPick EXISTING arc: ") "CEN"))
(setq pt2 (osnap (getpoint "\nPick start of arc: ") "end,int,mid"))
(setq arc_length (getdist "\nEnter arc Length: "))
); end second Progn
); end if ask resume
(defun FirstArcMan ()
(setq pt1 (OSNAP (getpoint "\nPick EXISTING arc: ") "CEN"))
(setq pt2 (osnap (getpoint "\nPick start of arc: ") "end,int,mid"))
(setq arc_length (getdist "\nEnter arc Length: "))
)
(princ)
;CODING ENDS HERE
Frank Zander
===========
Kenny,
After helping you out a while back and sending you all
the back Newsletters a while ago ...
Thanks,
Steve
======
http://www.afralisp.com/newsletter/2004/2004-16.htm (4 of 9) [23/03/2005 05:48:41 p.m.]
AfraLisp Newsletter No 2004-16
Hi, Kenny
...Bill
=====
I'm new to your news letter, so I'm not sure if you've seen these.
Oldy, but Goldy - The Clock :
http://www.suite101.com/files/mysites/AskAlice/Clock.htm
The Industrious Clock
http://www.lares.dti.ne.jp/%7Eyugo/storage/monocrafts_ver3/03/index.html
John Alferes
==========
Hello Kenny,
---
best regards,
Vaidas Guogis
www.kitox.com
=============
Install-us makes it easy to create your own installation applications within minutes.
Install-us brings many powerful features, which will give you total control over the
installation issues of your software.
Features
========
Basics:
General:
Version check
Shared DLLs
Font Installation
Registration of file name extensions
Registration of ActiveX-servers (OCX)
Configurations:
Registry
Creates shortcuts on the desktop, in the start menu, in autostart...
Addtional features:
Program folders
Start programs after installation
Variables
Reboot and Relogin
Media such as Bitmaps, Audio and Video
ini-file modification
Protection possibilities:
Password and Expiry date
User Registration System
=====================
2. The Law of Reality: Never get into fights with ugly people,
they have nothing to lose.
3. The Law of Self Sacrifice: When you starve with a tiger, the
tiger starves last.
7. Boob's Law: You always find something in the last place you
look.
http://www.afralisp.com/newsletter/2004/2004-16.htm (7 of 9) [23/03/2005 05:48:41 p.m.]
AfraLisp Newsletter No 2004-16
10. Law of Volunteer Labor: People are always available for work
in the past tense.
17. Main's Law: For every action there is an equal and opposite
government program.
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/2004/2004-16.htm (8 of 9) [23/03/2005 05:48:41 p.m.]
AfraLisp Newsletter No 2004-16
http://www.afralisp.com/newsletter/newsletter.htm
You can also download most of the AfraLisp Newsletters,
in PDF format here:
http://www.afralisp.com/newsletter/news.zip ( 1033 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-17
=========================
Wednesday 16th June 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
If you can read this,... thank a teacher.......
=========================
Pearls of Wisdom
===============
Could it be that all those trick-or-treaters wearing sheets
aren't going as ghosts, but as mattresses?
===============
Coding
=======
-
-
-
-
http://www.afralisp.com/newsletter/2004/2004-17.htm (1 of 9) [23/03/2005 05:48:42 p.m.]
AfraLisp Newsletter No 2004-17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Nothing to put in here, 'cos it seems like nobody wants to talk to me.
=============
ResourceTool.exe
Ed Jobe © 2003
http://www.afralisp.com/lispb/resourced.htm
ResourceTool is a tool for use with VB to help with compiling resource dll's for a menu.
Normally, if you use the Resource Editor add-in and you load a bmp, the editor assings a
sequential number as the resource ID. This means that if you want to continue referring t
icons in your menu by a name, you have to rename all the ID's in the RES file.
This tool avoids using the rc.exe tool that comes with Visual Studio. This utility can
compile a C++ resource file (*.rc) into a VB resource file (*.RES).
================
NSIS
====
NSIS can create Windows installers that are capable of installing, uninstalling,
setting system settings, extracting files, etc.
Because NSIS is based on script files, you can create both simple or advanced installers.
http://nsis.sourceforge.net/
======================
You walk into a room and notice that a picture is hanging crooked. You...
A. Straighten it.
B. Ignore it.
C. Buy a CAD system and spend the next six months designing a solar-powered, self-adjusti
picture frame while often stating aloud your belief that the inventor of the nail was a
total moron.
The correct answer is "C" but partial credit can be given to anybody who writes "It depen
in the margin of the test or simply blames the whole stupid thing on "Marketing."
SOCIAL SKILLS
----------------------------
To the engineer, all matter in the universe can be placed into one of two categories:
Engineers like to solve problems. If there are no problems handily available, they will
create their own problems.
Normal people don't understand this concept; they believe that if it ain't broke,
don't fix it. Engineers believe that if it ain't broke, it doesn't have enough features y
No engineer looks at a television remote control without wondering what it would take to
it into a stun gun. No engineer can take a shower without wondering if some sort of Teflo
http://www.afralisp.com/newsletter/2004/2004-17.htm (4 of 9) [23/03/2005 05:48:42 p.m.]
AfraLisp Newsletter No 2004-17
coating would make showering unnecessary. To the engineer,
the world is a toy box full of sub-optimized and feature-poor toys.
Clothes are the lowest priority for an engineer, assuming the basic thresholds for temper
and decency have been satisfied. If no appendages are freezing or sticking together,
and if no genitalia or mammary glands are swinging around in plain view, then the objecti
of clothing has been met. Anything else is a waste.
Dating is never easy for engineers. A normal person will employ various indirect and
duplicitous methods to create a false impression of attractiveness. Engineers are
incapable of placing appearance above function.
Fortunately, engineers have an ace in the hole. They are widely recognized as superior
marriage material: intelligent, dependable, employed, honest, and handy around the house.
While it's true that many normal people would prefer not to date an engineer,
most normal people harbor an intense desire to mate with them, thus producing engineer
like children who will have high-paying jobs long before losing their virginity.
Male engineers reach their peak of sexual attractiveness later than normal men, becoming
irresistible erotic dynamos in their mid thirties to late forties.
Just look at these examples of sexually irresistible men in technical professions:
Bill Gates.
MacGyver.
Randall Rath
Etcetera.
Female engineers become irresistible at the age of consent and remain that way until
about thirty minutes after their clinical death.
Longer if it's a warm day.
HONESTY
-----------------
Engineers sometimes bend the truth to avoid work. They say things that sound like lies
but technically are not because nobody could be expected to believe them. The complete
list of engineer lies is listed below.
FRUGALITY
--------------------
Engineers are notoriously frugal. This is not because of cheapness or mean spirit;
it is simply because every spending situation is simply a problem in optimization,
that is, "How can I escape this situation while retaining the greatest amount of cash?"
POWERS OF CONCENTRATION
----------------------------------------------------
If there is one trait that best defines an engineer it is the ability to concentrate on
one subject to the complete exclusion of everything else in the environment.
This sometimes causes engineers to be pronounced dead prematurely. Some funeral
homes in high-tech areas have started checking resumes before processing the bodies.
Anybody with a degree in electrical engineering or experience in computer programming
is propped up in the lounge for a few days just to see if he or she snaps out of it.
RISK
---------
Engineers hate risk. They try to eliminate it whenever they can. This is understandable,
given that when an engineer makes one little mistake the media will treat it like it's a
big deal or something.
Hindenberg.
Space Shuttle Challenger.
SPANet(tm)
Hubble space telescope.
Apollo 13.
Titanic.
http://www.afralisp.com/newsletter/2004/2004-17.htm (6 of 9) [23/03/2005 05:48:42 p.m.]
AfraLisp Newsletter No 2004-17
Ford Pinto.
Corvair.
Windows (from an IT Engineers point of view).
Being practical people, engineers evaluate this balance of risks and rewards and decide
that risk is not a good thing.
The best way to avoid risk is by advising that any activity is technically impossible
for reasons that are far too complicated to explain.
If that approach is not sufficient to halt the project, then the engineer will fall back
to a second line of defense:
"It's technically possible but it will cost too much."
EGO
--------
Engineers will go without food and hygiene for days to solve a problem.
(Other times just because they forgot.)
And when they succeed in solving the problem they will experience an ego rush that is
better than sex -- and I'm including
the kind of sex where other people are involved.
Nothing is more threatening to the engineer than the suggestion that somebody has more
technical skill.
Normal people sometimes use that knowledge as a lever to extract more work from the engin
When an engineer says that something can't be done (a code phrase that means it's not fun
some clever normal people have learned to glance at the engineer with a look of compassio
pity and say something along these lines: "I'll ask Bob to figure it out. He knows how to
http://www.afralisp.com/newsletter/2004/2004-17.htm (7 of 9) [23/03/2005 05:48:42 p.m.]
AfraLisp Newsletter No 2004-17
difficult technical problems."
At that point it is a good idea for the normal person to not stand between the engineer a
the problem.
The engineer will set upon he problem like a starved Chihuahua on a pork chop.
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
The AfraLisp Books and the Newsletter Collections are now available as
one downloadable installation file.
http://www.afralisp.com/zip2/AfraLisp_Books.zip ( 5227 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2004-18
=========================
Friday 10th July 2004
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
For Hire:
A Professional Transvestite.
Likes to eat, drink and be Mary.
=========================
The AfraLisp Newsletter may be a wee bit intermittent for the foreseeable future due
to business and personal reasons.
Please do not adjust your sets as normal service will be resumed as soon as possible.
==============
This is a must.
http://www.go-opensource.org
I received my CD about a month ago, but have only got around to having a good look at it
about a week ago.
Have a look, it's well worth it and I love their ideas and aims…...
Pearls of Wisdom
===============
One Christmas I got a battery with a note saying, "Toy not included."
===============
Coding
=======
Kenny,
I hope to have my update to Topical Index of system variables ready by the end of June.
Would you like a copy when I finish to post on AFRALISP.com?
Gil Hoellerich
============
Of course I told him no, but he insisted.
So, with no further adieu:
http://www.afralisp.com/zip2/sysvar2004.ZIP
============
I am trying to get Express Tools from Acad 2000 to work with Acad 2002.
Is this possible? I have tried installing them using the step by step guide on your web s
When I try to use any Express Tool command I get the following error - error: no function
definition: ACET-AUTOLOAD.
Any other suggestions?
Thanks,
Mark Chiarizio
============
http://www.augafrica.com/docs/ExpressBonusTools.zip
http://www.afralisp.com/newsletter/2004/2004-18.htm (2 of 14) [23/03/2005 05:48:44 p.m.]
AfraLisp Newsletter No 2004-18
============
Kenny,
I have searched and surfed endlessly for answers concerning Autolisp problems that I
am having.
I keep coming back to Afralisp and Reini Urban for answers. I have found these to be
the most informative web sites for lisps.
But now I am stumped.
I have been working on a routine that will that will ( should) insert, from a folder
containing several title blocks, a title block that
I select with attributes and will allow me to edit the attributes on insertion.
And should allow future updates to the block / blocks thru a dialog box.
Of course the simple lisp I have now inserts a predefined title block and automatically
inserts the title info as text entities, and counts up the page number by 1.
I use multiple tabs for one job in a file. Each time I use the lisp it creates a
new tab with all the right settings and inserts one title block.
However, the info is entered through the use of "command"s in the lisp and once I
save and close the file, all info variables are lost. I could write the info to a file,
but I hate creating more job specific files than what is really needed. If the title
block had attributes, I could use something similar to the "attab" or "attab_vl" lisps
on your web site.
http://www.afralisp.com/lisp/attab.htm
Currently I have modified the code to create a new tab, insert the title block,
and change the info if needed. However, using the function again, it only
retrieves / updates the first inserted block. So I went back to the original source
code of "Attab" to see what happened after inserting the default block the lisp came with
It worked fine. I inserted the block again.
Ran the lisp, and only the last block updates.
After researching many similar routines, the following excerpt seems to be frequently use
"(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))"
Shouldn't this update all the blocks with "insert" properties, and with entities that fol
As I had mentioned, several routines use this same method of retrieving block data.
Why does this not update all the title blocks within a drawing file? I am so handicapped
when it comes to group code use, and how to update attributes. How come the above method
seems to work for everyone else but me?
If you think having the lisp I am working on will help, I will e-mail it to you.
As it is, I am willing to bet you know what my problem is already.
I will appreciate any help you have to offer.
Thank you,
Robert
======
Kenny,
I got your latest newsletter today and wonder why you did not include my "Bottom of
Steel" list routine in the code section; seeing as you have nothing else there.
Is there a problem with the code? I hope you got it as one time an email I sent was
listed as undeliverable but said they would keep trying and that was the last I heard.
Please let me know what is up. In the meantime, I'll see if I can come up with some
more jokes for you. I never saw the joke about Budweiser in the newsletter either.
Thanks
Jim
===
Jim, your program uses slide images contained in a slide library that is impossible
for me to publish within a text based Newsletter. I will though, within the very near
future, make it available as a download on AfraLisp.
=======================
Kenny,
I am sure ALL your readers will find this lisp program VERY useful ;-) I wrote this
one a few years ago (don't ask me how it works) to draw log-log graph paper. You can
copy the end result as required to produce any number of cycles.
Two cows were grazing in a paddock. The sky was blue, the sun was shining,
there was a cool gentle breeze blowing and the grass was so fresh and green -
let's face it, it was a great day to be a cow. Suddenly, one of the cows
stopped grazing. She slowly raised her head and said... "Moooo".
Then, the other cow said... "Oh rats. I was going to say that!"
===============
Some times I find it very handy to be able to draw a leader line in the reverse direction
That is, selecting points from, say a note, to the job (arrow end).
One of the drafters in our office only uses this method!
You may recognise some of the code - I stole it from the "Model Tab" code in the "lisp
tips" section on the Afralisp site.
(My coding additions may be a bit rough because it is a work in progress at the moment.)
Craig Green
===========
Hi Kenny,
I just wanted to drop you a line to tell you that I think your books Are excellent.
I have been a structural Draftie for the past 6 years, and recently completed a
degree in Computer Science.
I still do a bit of drafting and wanted to find out more about customising AutoCAD,
a few minutes of Googling later and I found AfraLISP.
I was originally born in Rhodesia and thought that finding a website in Africa
That had exactly what I was looking for was quite ironic.
I have only just embarked on my CAD customization skills but have found your
Books to be extremely useful and straight forward.
Thanks,
Antony Hall
===========
Hi, Kenny,
Wow. I just happened to bump into your web doing a search for Excel VBA.
Anyway, I just wanted to invite you over:
www.vbaexpress.com/forum
Thanks!!
~Anne Troy
===========
http://www.afralisp.com/newsletter/2004/2004-18.htm (9 of 14) [23/03/2005 05:48:51 p.m.]
AfraLisp Newsletter No 2004-18
I went, I saw, I left………
Ouch, stop it Kenny, you're getting grouchy again…… ===========
Hello!
But when the polyline is closed, this function is wrong : the last point of the
polyligne must be the fisrt point !
I modify your function like this :
coords = ent.Coordinates
lb = LBound(coords)
ub = UBound(coords)
For i = lb To ub - 2 Step 2
bulge = ent.GetBulge(i / 2)
x1 = coords(i)
y1 = coords(i + 1)
x2 = coords(i + 2)
y2 = coords(i + 3)
If bulge = 0 Then
Totaldist = Totaldist + Calculate3DDistance(x1, y1, 0, x2, y2, 0)
Else:
Totaldist = Totaldist + CalculateArcLength(x1, y1, 0, x2, y2, 0, bulge)
End If
Next i
CalculatePolylineLength = Totaldist
End Function
But, with the autocad 2004 polyline.length property, this beautiful job is
no more necessary ....
René Pralat
===========
Thanks Rene. (That's "Rene" with the little funny squiggle above the second "e".)
Bloody froggies!!!!
================
I am American
=============
I like big cars, big boats, big motorcycles, big houses and big campfires.
I believe the money I make belongs to me and my family, not some governmental
stooge with a bad comb-over who wants to give it away to crack addicts for
squirting out babies.
Guns do not make you a killer. I think killing makes you a killer.
You can kill someone with a baseball bat or a car, but no one is trying to
ban you from driving to the ball game.
I believe they are called the Boy Scouts for a reason, that is why there are
no girls allowed. Girls belong in the Girl Scouts!
ARE YOU LISTENING MARTHA BURKE?
http://www.afralisp.com/newsletter/2004/2004-18.htm (11 of 14) [23/03/2005 05:48:51 p.m.]
AfraLisp Newsletter No 2004-18
The only things I can think of that are truly discriminatory are things like
the United Negro College Fund, Jet Magazine, Black Entertainment Television,
and Miss Black America. Try to have things like the United Caucasian College
Fund, Cloud Magazine, White Entertainment Television, or Miss White America;
and see what happens. Jesse Jackson will be knocking down your door.
I have the right "NOT" to be tolerant of others because they are different,
weird, or tick me off.
My father and grandfather didn't die in vain so you can leave the countries
you were born in to come over and disrespect ours.
I think the police should have every right to shoot your sorry self if you
threaten them after they tell you to stop. If you can't understand the word
"freeze" or "stop" in English, see the above lines.
I don't think just because you were not born in this country, you are
qualified for any special loan programs, government sponsored bank loans
or tax breaks, etc., so you can open a hotel, coffee shop, trinket store,
or any other business.
We did not go to the aid of certain foreign countries and risk our lives in
wars to defend their freedoms, so that decades later they could come over
here and tell us our constitution is a living document; and open to their
interpretations.
I know pro wrestling is fake, but so are movies and television. That doesn't
stop you from watching them.
I think Bill Gates has every right to keep every penny he made and continue
to make more. If it ticks you off, go invent the next operating system that's
better, and put your name on the building. Ask your buddy that invented the
http://www.afralisp.com/newsletter/2004/2004-18.htm (12 of 14) [23/03/2005 05:48:51 p.m.]
AfraLisp Newsletter No 2004-18
Internet to help you.
It doesn't take a whole village to raise a child right, but it does take a
parent to stand up to the kid; and smack their little behinds when necessary,
and say "NO!"
"I think tattoos and piercing are fine if you want them, but please don't
pretend they are a political statement. And, please, stay home until that
new lip ring heals. I don't want to look at your ugly infected mouth as you
serve me french fries!
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
The AfraLisp Books and the Newsletter Collections are now available as one
downloadable installation file.
http://www.afralisp.com/zip2/AfraLisp_Books.zip ( 5227 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^
AfraLisp Newsletter No 2004-19
^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^
On top of that, I've invited certain targeted people to participate in a whole new vision
of CAD related utterances. Why you may ask?
There are CAD forums around that do a sterling job of answering day to day questions
and many of you, like myself are very involved with them. But, I really believe that
there are some of you that would rather take a wee bit of time to put your thoughts on
paper and have them read and digested by a more discerning type of audience.
The people who have contributed in this issue have been threatened rather badly by myself
my two sons, my three next door neighbours and my bank manager. I am though, eternally
grateful and would like to thank them profusely. I would also like to extend an open
invitation to anyone else who would like to submit an article. Any subject, it doesn't
http://www.afralisp.com/newsletter/2004/2004-19.htm (1 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
particularly have to be about coding or CAD, it could be about anything that you feel
would be of interest to the readers.
Tell us about your job, a recent holiday, a funny thing that happened the other day,
etc, etc.
Of course this does not mean we won't be discussing CAD or coding, this I'm sure will
still be the main subject, I would just like to try and encourage other subject writers
to participate and hopefully we'll all learn something new.
Anyway, enough waffle from me and let's get on with the show.
Oh, one last thing, the next publication date will be Tuesday the 3rd of August, so I
will require all contributions by Monday the 2nd.
Kenny
======
Pearls of Wisdom
===============
When, where, how, and who discovered the exact time?
===============
Words of Wisdom
===============
The Cornfield
============
Col I.
=====
Hello and welcome to the first Cornfield column in the AfraLisp Newsletter.
Since this is the first one I will do a bit of introducing myself, and the column.
My name is Andy but everyone calls me Cornbread. I served for 8 years in the U.S.M.C
and my nickname comes from my time there. It stuck even after I left so I guess it’s
here to stay. I am a GIS developer for the world’s largest telecom and data provider.
Since my employer would rather not be mentioned I’ll let you figure out for whom I work.
So since my background is largely GIS and Civil the articles in this column will be
heavily slanted in that direction. I suppose if you classify developers by their
language of choice I would be considered a C and C++ developer. I however enjoy using
many other types of languages from Lisp to Php. For most articles I will be using
Microsoft’s Visual C++ for the code and examples. If you don’t have Visual Studio
the compiler and linker can be obtained for free here:
http://www.afralisp.com/newsletter/2004/2004-19.htm (2 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
http://msdn.microsoft.com/visualc/vctoolkit2003/
The next few articles will be on how to read and write ESRI shape files from
within AutoCAD.
So first will be writing data out of drawings into shape files then after we are
done with that we will cover reading data into the drawing from shape files.
We will be covering simple geometry shape files first and then if there is enough
demand I will cover complex geometry files following that. If there isn’t enough
demand for complex geometry files we will move directly into reading and writing
MapInfo .tab files. I will be using sample data, which was publicly available from
a South African web site. If you are from Africa and have some GIS data in a drawing
file that you want used in the demo apps please contact Kenny and we can go from there
as I do not have server space to host uploads. I would like to keep the examples in
African data sets preferably South Africa. So if you have some spatial data in drawing
files or have shape files please let Kenny and I know and I will take a look at them
and possibly use them in the demo. Shape files of streets in any well known African
city would be excellent as I could not find any on line.
This column was just a bit of an introduction. They next column will begin the tutorial.
The languages to be used will be C and C++. The project will be an .arx project done
in VC++6.
We will be using portions of the source from this library:
http://dl.maptools.org/dl/shapelib/
Boxed In.
=========
By Mr Randall Rath himself.
Occasionally Marie will decide that my office needs to be cleaned. She does this,
in her words, as a "favor" to me. I can think of no single other thing that I dread
more than a good "Marie"
cleaning of my office. You see, everything ends up in a box or, more accurately,
several unmarked boxes hidden deep within the bowels of our storage room.
Tax papers? Those are in the box with AC adapters and cables. Hard drives? Software CD's?
Checks? All in the same box, the one that was marked "Kitchen" but has since been
crossed out.
Of course, she doesn't know that they're in those boxes, I discover that later
when I need one of the aforementioned items. The conversation goes something like,
You see, Marie thinks I hoard. Oh, she has never said it out loud, but I can see that
she thinks it.
She doesn't see the point behind keeping adapters, modems, old mother boards, well,
you get the idea.
One day she will thank me for keeping all of these items, when the world has finally
hit a shortage of AC adapters or modems became a valuable source of plastic.
http://www.afralisp.com/newsletter/2004/2004-19.htm (4 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
And those motherboards? They contain GOLD fer cry'n out loud! Who throws gold away?
But really, the point is that it's Marie who fills our home with crap.
In our Kitchen she keeps a bag full of those ketchup packages you get from fast food
restaurants and we have a drawer full of plastic spoons with a napkin wrapped in little
plastic envelopes.
Old telephone directories? She keeps them. There's a whole stack of them next to her desk
In the end I found my MSDN cases. Before she packed them away she reorganized them for me
They are now all sorted by color. And yet, were I to run over her with my car, they would
call me the criminal.
===========
Marie Rath
=========
; rot.lsp - Rotates selected objects about a reference point through a selected angle.
;C W Green 9/3/99
(defun c:rot ( / p1 p2)
(prompt "\nSelect objects to rotate: ")
(ssget)
(setq p1 (getpoint "\nCentre of rotation: "))
(setq p2 (getpoint p1 "\nReference point: "))
(command "rotate" "p" "" p1 "r" p1 p2 pause)
(princ)
);defun
(princ)
Load the program into AutoCAD and type "rot". Select the required object(s),
select the centre of rotation followed by the reference point
(normally the end point etc of one of the objects to be rotated) and
finally select the point you want the objects rotated to.
I think you will find the program saves a few steps and is a whole lot easier to use.
DOSLib:
I am a big fan of DOSLib. - Thanks Kenny for putting me on to it! If you haven't
heard of it before, it basically provides an extension to the AutoLISP command
language and provides Drive functions, Path functions, Directory functions,
File functions, Printer functions, Configuration functions, Process functions,
Graphical User Interface functions, String functions, AutoCAD Specific functions,
DOSLib functions and System and Other functions.
I have found the Graphical User Interface functions particularly useful as they
often remove the need to write DCL code. You can create quite professional looking
programs with the minimum of fuss. As far as I'm concerned, it is a 'MUST HAVE',
and it's FREE from Robert McNeel & Associates ( www.mcneel.com ). The current
http://www.afralisp.com/newsletter/2004/2004-19.htm (6 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
version is DOSLib 6.1.
There are varieties of the program for the different versions of AutoCAD and a
very comprehensive manual is provided. There are a number of ways of loading
DOSLib (refer to the manual), but I just use AutoCAD's appload function to add the
required DOSLib .ARX file to the startup suit.
Having said all this, I did run into a small problem recently using DOSLib - and
please note, this is the only problem I have ever had using DOSLib. I developed a
reasonably large lisp program using many of the DOSLib 6.1 functions. The program
worked fine in AutoCAD2000, but 'crashed' when run in AutoCAD 2004. I tracked the
problem down to some sort of clash between the dos_splash command and the
dos_msgboxex command.
(dos_splash and dos_msgboxex are DOSLib functions.) The splash command displays
one of those annoying bit maps when you start a program and I used the msgboxex
command to display the opening option menu for my LISP program.
The offending code fragment is shown below - (Don't bother loading it, as it
is incomplete and the required bit map file is not provided):
(defun c:autorev ()
(dos_splash "c://autorev.bmp" 2) ; Display the bit map file for 2 seconds ;
(setq text "Drawing Revision Program")
(setq buttons (list "Define Revision" "AutoRev" "Test" "Exit")) ; Program options
(setq option (dos_msgboxex text "AutoRev:" buttons 4)) ; Run the required option
(cond ((= option 0) (revdef))) (cond ((= option 1) (revup1)))
(cond ((= option 2) (revdwg))) (cond ((= option 3) (exit)))
)
I emailed Robert McNeel & Associates seeking a resolution to this problem and
received an email the following day with a revised version of DOSLib for AutoCAD 2004.
I think you would have to agree this sort of support for any program, let alone a
free one, is not bad at all! Needless to say, the revised version fixed the
'crashing' problem.
Dale, from Robert McNeel & Associates, informed me that the culprit was the
splash function.
Apparently both dos_splash and dos_msgboxex are multi-threaded functions.
I have no idea what this means but he sure fixed the problem!
If you have any interesting lisp programs using DOSLib, please send them in to Kenny.
I know I would be interested in seeing them and they may give others (and me)
ideas for future programs.
Craig Green
http://www.afralisp.com/newsletter/2004/2004-19.htm (7 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
========
Many years ago when I started using, and selling, AutoCAD the price was
very competitive.
About 20 years ago AutoCAD was a saviour to many designers when the only
other systems on the market were bundled with dedicated hardware and sold
for many times AutoCAD’s price.
In anticipation of AutoCAD coming out on something better than the IBM PC’s
320 x 200 resolution 4-colour option, I bought a NCR DM5 PC running on its
own version of DOS.
This PC, the NCR DM5, gave a “fantastic” 640 x 480, 8 colour option, and
was a great improvement. It was not a long wait before AutoCAD was available
on many other platforms including the NCR DM5.
(Some of the other platforms that AutoCAD supported were Wang, Radio Shack,
Hewlett Packard and Olivetti and later on also Apple Mac, Unix in the form of
SCO and Sun Spark.)
“What has this got to do with price?” I hear you say. Well, it allowed
Autodesk to have a very wide user base, and the customers a very good
entry price. Over the years AutoCAD has improved enormously and Autodesk
have cut back to running only on Microsoft Windows, but the prices have increased
enormously.
I am not a marketing “fundi” and I do realise that the market determines the
price of any goods. As long as people are prepared to pay the asking price,
even if relatively high, then the product will sell. My argument however is
that there is a correlation between the price of a product and the sales volumes.
Simply put, if you sold twice the volume by halving the price you would still
realise the same turnover.
If you however sold 3 times as much by halving the price, then the price
reduction is justified.
You would also be better off strategically by gaining a larger market share.
After all, AutoCAD’s wide user base is a direct result of its affordability
when first launched, especially by the small one-man size businesses.
Please note that this is my personal opinion and is not the opinion of any other
person or company.
Terry Baker
==========
Daves Corner
===========
Here is a little something to get started. I have recently been playing around
with this lisp routine.
It was not originally written by myself.
It was originally a routine to write the co-ordinates of picked points to an
ASCII file.
I adapted it to create a table in AutoCAD. I have since modified it to add a
few more choices as to how the table is drawn, ie with or without labels and
levels and also to read the 3D info of the selected points. The most recent
modification made is to select a polyline and automatically number the
vertices and add the generated number along with the co-ordinates of the
vertex to the table. I have placed the routine in a zip file as the coding is
quite long.
http://www.afralisp.com/zip2/coordtbl.zip
www.cadtutor.net
www.postalcad.com
www.ikozmos.com
www.3dm-mc.com
www.accustudio.com
Dave Corral
==========
Because AutoLISP is what I know best of the API's that AutoCAD has to offer,
any ramblings of mine here will be entangled with parantheses. However, while
being honored to contribute (and thankful for keeping my legs), I don't think
there are many subjects that haven't already been covered on the AfraLisp website
and that alone can make it a bit of a hurdle to come up with new topics. So,
if you have any ideas for future topics, please let me know - either via Kenny
http://www.afralisp.com/newsletter/2004/2004-19.htm (10 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
or directly at [email protected]
In this issue I thought we might have a look at how images are accessed via
AutoLISP.
We won't go deep into detail or write much code but it will be a rather long
rant, anyhow.
So it’ll be the only topic from my hand this time.
AutoCAD has plenty of commands to deal with images, the center of which is the
Image Manager. I don't think I've ever heard anyone complain about shortcomings
of the image facilities so why even bother to dig into the subject? Two reasons.
It can often be confusing to obtain information on how images are stored - and
the more information, the better. Number two reason is that some useful routines
can, after all, be written to extend the existing facilities.
Ever thought there should to be an IMAGEDETACH command like there is an IMAGEATTACH
command? It wouldn't be difficult to write one.
Images have much in common with blocks in the sense that multiple instances of the
same image can point to the same image attachment. To start explaining how this is
accomplished, try the following sequence:
- Open the Image Manager with command IMAGE and attach an image.
- Use COPY to make a few copies of the image in model space.
- Open the Image Manager again. Notice that there is only one image attached.
Click on Browse and select a different image. Exit the Image Manager by hitting OK.
- Back in model space, all images will change to the new image.
Image definitions hold very little but crucial information. First and foremost, it
contains the name of the image file and the path, if specified. Other pieces of
information kept by the image definition are: Image size in pixels, units of a pixel,
load/unload status and resolution units.
As we would expect, the definition doesn't keep information about insertion point,
rotation, scale factor and other things that are specific to the onscreen representation.
Those properties are related to the image entity.
You may have noticed that each image is given a name by the Image Manager. The default
http://www.afralisp.com/newsletter/2004/2004-19.htm (11 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
name is simply the image file with the extension cut off but it can be renamed arbitraril
following standard naming conventions. However, the name is not part of the image definit
entity list because it doesn’t need to be, due to the way dictionary entries are built.
Let’s try and insert an image and see how it’s put together. For the sake of this virtual
test, let’s say we have an image with the filename and path “C:\Images\house.jpg”.
Let the size be 640x380 pixels and the resolution 96 dpi.
We now attach the image - via the Image Manager - at WCS 0,0,0 in model space.
Scale factor is 1.0 and rotation is zero (we take it that the path is saved with the imag
After completing the attachment, the image will be named “house”, which is simply the
base file name. Using ENTGET and ENTLAST we can get an entity list similar to this:
This is the IMAGE entity that is saved in the drawing database along with all
other graphical entities. The image definition resides in the main dictionary
in an entry called “ACAD_IMAGE_DICT”.
Let’s try to do a search for our image:
Notice that the entity name of the dictionary entry, <Entity name: 7ef710d0>,
is the same as the entity name in code 340 of the IMAGE entity. That’s the only
immediate link between the image entity and the image definition (there are
other links but we won't go there this time). Whether we get hold of the image
definition by image entity or by dictionary is almost indifferent, 'almost'
because in the case where all image entities have been deleted, i.e. in the
case of an unreferenced image definition, the only way is to tap into the dictionary.
http://www.afralisp.com/newsletter/2004/2004-19.htm (12 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
The returned entity will look similar to this (with the reactor stuff cut out):
Code 10 is not an insertion point; it’s the dimensions of the image in pixels.
Code 11 is a unit vector that describes the number of units per pixel and code 281
is the resolution unit.
These data remain static until the image definition is deleted or changed by
referencing another file. From it we can calculate image dimensions in
drawing units: X_units = width * U, where U is the X-portion of the unit vector.
The calculation is similar for the Y direction.
So with a resolution unit of millimeters, the image width and height will be:
The dimensions depend on the resolution units in code 281, which initially depends on
information in the graphics file or the system variable INSUNITS. Either way,
the image definition unit vector is unitless in the sense that it always is
expressed in units per pixel.
It's only when creating an image entity that the resolution unit is used,
hence the need for keeping the information separate in code 281
(and using INSUNITS).
For example, if the image is attached using inches as the resolution unit,
the image is scaled by a factor of 25.4 in proportion to metric units.
To convert manually, simply divide by 25.4 (or multiply if you're in inches a
nd want millimeters):
(setq x_units (/ x_units 25.4)) -> 6.6667 (setq y_units (/ y_units 25.4)) -> 3.9583
>From the unit vector, you can extract the resolution of the image. If
>you want it in dpi, simply
http://www.afralisp.com/newsletter/2004/2004-19.htm (13 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
divide 25.4 with the unit vector:
(setq x_res (/ 25.4 (car (cdr (assoc 11 imgDef))))) -> 96.0 dpi
(setq y_res (/ 25.4 (cadr (cdr (assoc 11 imgDef))))) -> 96.0 dpi
When the image is inserted into the drawing, it can be scaled and rotated arbitrarily.
This will not affect the image definition values. As implied above, the
image definition needs to keep the parameters intact so that multiple image
entities can be created without affecting each other. Changing INSUNITS between
attachments will affect the scaling factors of existing images but it will not
affect the physical size because it's in a given relation to the unit vector of
the image definition.
The image entity holds alot more info than the definition. Naturally, it holds the
insertion point but it has no need of an explicit rotation angle or scaling factor
because it has its own set of unit vectors from which to calculate both angle and
scale. Unit vectors are given for both X and Y directions, or in terms of image mapping,
in U and V directions. This means that there can actually be separate rotations and
scale factors for any given image (as a funny side effect it also means that it is
possible to skew an image). But AutoCAD always uses the U vector for rotation and scale.
To calculate the rotation of the image, extract the U vector in code 11 and make use of A
The scale factor is a little more complicated because it depends on the current
setting of INSUNITS.
It's always possible to get hold of the scale factor between an image entity and
the corresponding image defintion by comparing the X-portions of unit vectors.
If you ever need the scale relationship between multiple instances of the same
images you can do the same but with image entity vectors (it will give the
difference between INSUNITS at the time of attachments).
Other properties in the image entity are the brightness, contrast and fade values.
http://www.afralisp.com/newsletter/2004/2004-19.htm (14 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
They can be interesting from a programming point of view because changes can be
applied to multiple images in one go.
Clipping coordinates are embedded directly within the image entity. When an image
is inserted, it has two diagonally clipping points set by default. They don't
affect clipping but can be adjusted to whatever you want. If you add clipping
point to make a polygonal clipping then remember to provide the correct number
of vertices in code 91.
Stig Madsen
===========
We use AutoCAD Mechanical and have chosen to stay at version 6 for right now
(its AutoCAD 2002). Well it seems that some of our customers use Mechanical 2004,
that seems okay, we just tell them to save down to AutoCAD 2000.
Well, that works for plain AutoCAD but not the Mechanical version, it crashes
version 6 whenever you open the "saved to 2000 version".
We fix it by opening it in 2004 (we carry one seat for compatibility issues),
wblocking the entities (in modelspace only, its a wblock thing) and then
reopening it in 2004 and then saving to 2000...
stupid. I got on the Autodesk forum and asked about it, the rep said we
should install 2004 across the board and the problem would go away.
Wrong answer.
I realize you cannot support older software forever, but when you say
you save to an older version, it should able to be opened in that older version.
Wow, glad I got that off my chest. Thanks and keep up the good work.
John Walker
===========
HANGOVERS
===========
No pain, but something is definitely amiss. You may look okay, but you have the
http://www.afralisp.com/newsletter/2004/2004-19.htm (17 of 19) [23/03/2005 05:48:54 p.m.]
AfraLisp Newsletter No 2004-19
mental capacity of a staple gun. The coffee you are chugging is only increasing
your rumbling gut, which is still tossing around the fruity pancake from the
3:00 AM Curry House excursion. There is some definite havoc being wreaked upon your bowel
Slight headache. Stomach feels crappy. You are definitely not productive.
Anytime a girl walks by you gag because her perfume reminds you of the
flavored schnapps shots your alcoholic friends dared you to drink.
Life would be better right now if you were home in your bed watching Lucy reruns.
You've had 4 cups of coffee, a gallon of water, 3 iced teas and a diet Coke ---
yet you haven't peed once.
Life sucks. Your head is throbbing. You can't speak too quickly or else you might puke.
Your boss has already lambasted you for being late and has given you a lecture for
reeking of booze. You wore nice clothes, but that can't hide the fact that you
only shaved one side of your face. (For the ladies, it looks like you put your
makeup on while riding the bumper cars.) Your eyes look like one big red vein,
and even your hair hurts. Your sphincter is in perpetual spasm, and the first
of about five shits you take during the day brings water to the eyes of everyone
who enters the bathroom.
You have a second heartbeat in your head, which is actually annoying the employee
who sits in the next cube. Vodka vapor is seeping out of every pore and making you
dizzy. You still have toothpaste crust in the corners of your mouth from brushing
your teeth in an attempt to get the remnants of the poop fairy out. Your body has
lost the ability to generate saliva so your tongue is suffocating you. You don't
have the foggiest idea who the hell the stranger was passed out in your bed this
morning. Any attempt to defecate results in a fire hose like discharge of
alcohol-scented fluid with a rare 'floater' thrown in. The sole purpose of this
'floater' seems to be to splash the toilet water all over your ass. Death sounds
pretty good right about now....
^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-^-.,.-
---------------------------------------------------------
AfraLisp :
http://www.afralisp.com
mailto:[email protected]
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
The AfraLisp Books and the Newsletter Collections are now available as one
downloadable installation file.
http://www.afralisp.com/zip2/AfraLisp_Books.zip ( 5227 kb )
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-01
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
This space left blank 'cos the paint is still drying.
=========================
If you've got any sense and would like to make a couple of dollars or two, I would suggest that you
archive this email somewhere very safe 'cos in a couple of years it will become quite collectable.
Why? Don't ask me, I'm just the bleedin' pencil jockey who gets forced into writing this Newsletter,
never gets paid and basically does it for the love of his fellow homo-sapien. (Go on, groan, I don't
care, I can take it).
Anyway, where was I, oh yeah, I was about to tell you all about the "AfraLisp Newsletter", it's ideals
and desires, it's wish for peace for all mankind, the hope that all children through out the world will
have an education and live a happy and fulfilled life, the expectancy that you all will think that I'm
witty and funny and will send me vast quantities of beer from your home countries. And that folks
is just my aim for this first issue!!!
=========
"What the heck are you waffling on about Kenny?"
Okay, here's the deal. Dead simple.
The idea of this Newsletter is basically to allow me, and you of course, to have your say
concerning AutoLisp/Visual Lisp/VBA or VB. It could be a coding snippet that you would like the
world to see, or a good coding site that you've just come across, or maybe just a bitch at AutoDesk
for charging you too much for their product. In fact, anything - the juicier and more gossip ridden
the better!!
Then again, you might even come across a site or some article that is SO GOOD but has nothing to
do with coding but you feel, deep down in your heart, that we all should know about it. That's also
fine and in fact will be encouraged.
I'd also like this Newsletter to be a place where AutoCAD coders who are maybe a wee bit busy to
spend time on-line, or have a problem getting on-line, can catch up on what is going on, and can
still participate without incuring the wrath of their IT departments, wives, girlfriends,
bit-on-the-side, etc.
I will, and now I give you all plenty of notice, be "borrowing" all sorts of things from all sorts of
places - such as emails that I may happen to receive- so please, watch your language. I will also,
on top of all that, be letting you know about any other sort of weird and wondeful subject that I
may happen to stumble across.
===========
Pearls of Wisdom
===============
Coding
=======
{this is where your input is required)
To be honest (sic), the menu is basically an accumulation of AutoLisp routines that I've written,
re-written, stolen, been given, gathered and modified over the years. Each routine, well most, have
been used extensively within a professional drawing office over the past 10 to 12 years and are still
being used in a production environment to this day.
I'd also like to let you know that the AfraLisp 2002 Custom Menu has been extensively tested (well
sort off) on AutoCAD 2002 and an old 1968 Ford Escort with a re-engineered carburetor. The
AfraLisp 2002 Custom Menu should work on AutoCAD 2000 and 2000i and maybe (???) even on
AutoCAD R14 although I haven't performed any testing on any of them. (and don't intend too
either.)
The AfraLisp 2002 Custom Menu consists of 15 main sections and numerous sub-sections named
1 to 15. The menu has cunningly been divided into subject related work areas that have been
chosen and designed to confuse you as much as possible.
Download your copy now - http://www.afralisp.com/
Hey, it's free.......
====================
Besides some pesky little bug-fixes, this also includes a new menu resource DLL thanks to John
Raiten. The bug fix is a doozy. Get this: I pound my feeble chest with the updated stuff in the
Visual LISP book regarding changes in AutoCAD 2004 Vlisp, and I end up eating my own mess.
In particular, the issue of (vlax-put) not working on certain objects.
For those of you doing VLISP programming, you must now use (vlax-put-property) instead. If
you're using 2004.03.21, try the DSL command on an associative dimension and you'll see what I
mean. That's fixed now. I should follow my own advise, huh?
--------------------------------------------------
DSX Tools 2004.04.26.03 Posted in English, German only
In addition to language limitations, I've added a download for a Microsoft SMS package file for use
with SMS 2.0 or 2003. This allows you folks using SMS to easily build a package to deploy this
around your network.
I'm not planning to post installers for Spanish, Italian or French unless I get requests to do so.
------------
DSX Tools - Freeware for AutoCAD
http://www.dsxcad.com/
===============
Function Split(ByVal Text As String, Optional ByVal Delimiter As String = " ", _
Optional ByVal Limit As Long = -1, Optional CompareMethod As _
VbCompareMethod = vbBinaryCompare) As Variant
ReDim res(0 To 100) As String
Dim resCount As Long
length = Len(Text)
startIndex = 1
End Function
Just wanted to drop you a line and say thanks for all of the tid-bits of lisp codes and humor. I'm
designing some software for the millwork industry and if I ever get it off the ground I'll be glad to
donate a few ducketts towards the beer fund.
I'm also a musician and like to drink beer (the music helps me get women. The beer makes them
look better!!)
Thanx again
John Michael Hivatal
===========
Hello,
I was just told about this web site and I must tell ya I really like it.
Here is a little trick that I did to my osnap cursor menu.I come across a lot of users who are not
aware of this function, 'Cal - Mee.
I'm sure you know what it does, so I won't waste time.
I used to use a 12 button puck & tablet and had this programmed on button #4. Now, in the modern
world of the InteliMouse, I have given up my beloved tablet,
so here is what i have done the my Acad menu.
Perhaps you might agree that this is a pretty handy tip, or maybe not. In any case, thanks for the
informative web site.
John Lauer
AutoCAD 2004.
I just received my upgrade a couple of weeks ago.
Because of the Easter hols, I've only had a chance to have a wee look.
The Jury is Still Out.
More in the next issue.
Oh, and talking about AutoCAD, have you seen my write up on Autocad VV-Light?
You'll find it under the "Rubbish" section at http://www.afralisp.com
==================
Next week I'll also be having a look at some AutoCad Coding sites and listing them hereupon. So,
if you have or know about a site, just let me know.
Here's a wee taste :
CAD Encoding - The Journal is focused on helping you to improve your work environment with
tutorials and working code examples written in, and for, the most popular customizing languages
for the major CAD software programs and Microsoft Office products - Visual Basic for
Applications, Visual Basic, Visual C++, AutoLisp, Visual Lisp, and DCL.
http://www.cadencoding.com
If you feel that you would also like to become a lowly unpaid hack. or have visions of grandeur by
seeing your name in print, then drop me a line at this address:
mailto:[email protected]
Ever Wonder........
...why the sun lightens our hair, but darkens our skin?
...why you don't ever see the headline Psychic Wins Lottery?
...why lemon juice is made with artificial flavor, while dishwashing liquid is made with real lemons?
...why the man who invests all your money is called a broker?
...who tastes dog food when it has a new & improved flavor?
...why they don't make the whole plane out of the material used for the indestructible black box ?
...why they are called apartments when they are all stuck together?
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com
Look under the "Newsletter" section.
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
(The drunker you are, the better we sound!!)
http://www.BedrockBand.com
----------------------------------------------------------
To subscribe to AfraLisp go to the main page :
http://www.afralisp.com
enter your e-mail address and press the button.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-02
=========================
8th May 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Free Gift to be inserted here.
=========================
Well another week has passed us by and Christmas is getting closer. Have you started shopping
yet? Talking about Christmas reminds me to tell you that my band BedRock has released their
third CD "SO Where's The Party Now?" Aptly named for a Christmas or Birthday present I would
say! You'll find further details towards the end of this letter.
I've had quite a lot of emails from people saying that it's nice to see the Newsletter back. I must say
that it's nice to be writing the Newsletter again as I enjoy insulting people and I enjoy it even more
that they seem to enjoy it!!
A few questions this week that need answering so please, take a few minutes and give me hand.
Thanks to everyone who has contributed so far, and please keep them coming.
And, on a totally different subject, have you ever felt like being the next James Bond? If so, try this
out : http://www.secretservicetest.co.uk
Pearls of Wisdom
===============
Drink wet cement, and get completely stoned.
===============
Coding
=======
Here is a quick little snippet to load, run then unload a vba routine. also
included are my basic error handling routines.
I have the routines saved in the mnl file associated with the menu I use to
run most of my routines, although the ACAd.mnl file would do just as well.
Regards
Michel Loftus
============
Play .avi files in your program. Use this code to create a simple AVI player of your own, or use one
line of it to just run a avi file. (VB6 required)
Declarations: none
On your form, place a CommonDialog, a CommandButton and a Animation
(called : commondialog1, command1 and animation1)
Animation, and Common Dialog can be found in the tool bar, if you have
Professional+ Form controls, if not look through the Components menu, (right
click tool bar) and look for them there.
Exit Sub
error: MsgBox Err.Description, vbCritical, "Error Number " & Err.Number
cancel:
' if the user clicks cancel, the program does not open, it just leaves the sub
End Sub
Sam Witney
============
John's correct that most people forget about the calculator function. While John's code works, it is
too limiting for me - MEE only uses endpoints, so this is a step better :
'cal;(cur + cur)/2;
where CUR is short for any point selection within the confines of the calculator routine.
MikeTuersley
=============
I saw your tip in adding "CAL -> MEE" into the cursor menu. I've had that little diddy in mine for
some time now. Here's some others I added to make life simpler:
[->Calculator]
[GeomCal]'cal;
[Midway]'cal;(cur+cur)/2;
[Int+Int / 2]'cal;(int+int)/2;
[End+End / 2]'cal;(end+end)/2;
[End-End Dist]'cal;dist(end,end);
[<-Line Int]'cal;ill(end,end,end,end);
I also added another section that allows OSNAP combinations like END -> END so you can do them
in one pick instead of having to keep going back to the cursor menu again. Here's the section from
my cursor menu:
[->Multiple]
[End - End]_endp;\_endp;
[End - Int]_endp;\_int;
[End - Mid]_endp;\_mid;
[End - Perp]_endp;\_perp;
[Int - Int]_int;\_int;
[Int - End]_int;\_end;
[Cen - Cen]_center;\_center;
[Mid - Int]_mid;\_int;
[Mid - Perp]_mid;\_perp;
[Near - End]_near;\_endp;
[Near - Int]_near;\_int;
[<-Near - Perp]_near;\_perp;
Jim Fisher
===========
Kenny,
Is there any way to code the basic input for civil polylines?
Thanks,
Garry
=======
Dear Sir,
We have a network and I want to attatch an XREF drawing from the server, when doing so I want all
the layers to be turned to the color red in order to differentiate between my work and the attached
layers from other departments.
Best Regards
Maged
========
Hey Kenny,
Have you ever wished that you could embed a LISP macro into a drawing for distribution that
would automatically load upon opening of the drawing, and wouldn't require any programs to
reside on the desination computer?
This routine will do that.
I thought it was pretty cool.
Just embed the vba macro into a drawing, and then you run The lisp macro routine inside that
drawing.
Then load the lispmacro.lsp and lispmacro.dcl files into the dialog box. (to help unload and reload
the routines).
Then load any lisp routine or dcl file you want into the dialog box.
The dvb file will unpack the lisp routines, load them and unpack any dcl files (or ascii files) upon
drawing opening.
Later
Peter Jamtgaard
==============
You can download this application here :
http://www.afralisp.com/zip1/lispmacro1.zip
You will find other similar routines such as this at :
http://www.augi.com/empower/exchange/searchdownloads.asp
==============
Hi. Gotta question. I work for a company that runs fiber optic cable from city to city. On my
Autocad prints, I will list the total footage between poles and then, total the footage the for the
entire sheet.
Question: Is there a way in Autocad to have Autocad extract these values and add
them automatically to avoid human error?
Keith
=====
I must also say thanks to those of you for your support in getting BedRocks track, "Crowd
Invasion", into the Top 20 of South African music mp3's. Hey, you can still download it here if you
wish : http://www.bedrockband.com/Crowd_Invasion.mp3
Now I'm gonna ask you to do it all again as another track from BedRocks latest CD, "So Where's
The Party Tonight?", has been made available on the SA mp3 site at http://www.samp3.com So, if
you've got a few minutes to spare, please pop along. You'll find our song "What Crap is That"
under the NEW column on the right of the page - each download registers a "hit" for us so please
spread the word to friends, co-workers, priests, policemen, shrinks, strangers in the
street...whosoever!
Oh, we now have a distribution deal in the States. You can order your copy of "So Where's The
Party?" from CDBaby: http://www.cdbaby.com/bedrock
Hey $10 a shot - not bad I would say.
Whenever your children are out of control, you can take comfort from the thought that even God's
omnipotence did not extend to his own children.
After creating heaven and earth, God created Adam and Eve. And the first thing he said was
'DON'T!'
A few minutes later, God saw his children having an apple break and he was ticked!
'Didn't I tell you not to eat the fruit?' God asked.
'Uh huh' Adam replied.
'Then why did you?' asked the father.
'I don't know' said Eve.
'She started it!' Adam said.
'Did not!'
'Did too!'
'DID NOT'
Having had it with the two of them, God's punishment was that Adam and Eve should have
children of their own. Thus the pattern was set and it has never changed.
If you have persistently and lovingly tried to give children wisdom and they haven't taken it, don't
be hard on yourself. If God had trouble raising children, what makes you think it would be a piece
of cake for you?
1. You spend the first two years of their life teaching them to walk and talk. Then you spend the
next sixteen telling them to sit down and shut up.
2. Grandchildren are God's reward for not killing your own children.
3. Mothers of teens now know why some animals eat their young.
4. Children seldom mis-quote you. In fact, they usually repeat word for word what you shouldn't
have said.
5. The main purpose of holding children's parties is to remind yourself that there are children more
awful than your own.
AND FINALLY:
IF YOU HAVE A LOT OF TENSION AND YOU GET A HEADACHE, DO WHAT IT SAYS
ON THE ASPIRIN BOTTLE: 'TAKE TWO ASPIRIN' AND 'KEEP AWAY FROM
CHILDREN'
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
(The drunker you are, the better we sound!!)
http://www.BedrockBand.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
=========================
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
"Corbimite.com"
http://www.corbimite.com
=========================
Wet Paint - Do NOT Touch!!
=========================
==============
Firstly, I must apologise for a number of grammar errors that slipped through the proverbial net in last weeks
Newsletter. And no, it wasn't too many beers in fact, quite the reverse.
There I was in a mad rush to go out, and without thinking, I pressed the "Send" button. I then suddenly
remembered that I hadn't proof read the bleedin' thing. That's what happens when you try and do important
things whilst sober!! I should have waited until I wobbled home later that night.
Question?
How do you set up your AutoCAD workstations? Do you just use vanilla AutoCAD on a stand alone PC, or
have you got multiple workstations to deal with? I'm not talking about your drawing office standards or
layering standards, I'm talking about your AutoCAD System Setup itself. Are all your drawings, menus and
custom support files on the Network, or do you keep all support files on the users local drive and the drawings
on the Network?
Do you deal with multiple configurations for various disciplines? Do you make use of Profiles or Template
drawings? Or do you have a super dooper "AutoCAD Multiple Configuration Application" written by a team
of expert C++ programmers?
If if the answer is "Yes" to any of the above, I'd be interested in hearing from you.
Pearls of Wisdom
===============
===============
Coding
=======
defpath ";"
netpath ";"
netpath "\\" "Menu;"
))
===================
Hi Kenny
Whazzup, Whasappening??
I was starting to get withdrawal symptoms! I missed your Afralisp newsletter. Oh well I survived. Here is a
collection of some of my lisp routines that I use very frequently on a daily basis and are also often used by
others in the office. They are very rough and ready, but they do the job quite nicely. I have quite a few ideas to
beef them up, but I'm sure there are many other coders out there that will also enjoy toying around with them
and tidying them up.
Cheers,
Dave
========
http://www.afralisp.com/lisp/dctools.htm
========
;close file
(close gfile)
;open file
;close file
(close gfile)
strname
);defun
;CODING ENDS HERE
===========
Kenny,
Hi there, my name is Michael. Cool site, love the humour. I am just getting back into some CAD programming
- stopped about 6 years ago before VLISP. I am bouncing between VLISP and VBA. My forehead is getting
sore from banging the computer monitor. I am stumped!
I am trying to find a point on a surface - not necessarily at a convienient vertex of course - have x,y get z from
surface kind of thing.
Simple, right? It started out promising and has been spiralling downhill.
If I could access the vertices, I could dust of my old algebra texts and calculate the Coons patches between
points - very ugly prospect.
The IntersectWith method looks good, but it either is not implemented yet, or its ARX is not loaded. AutoCAD
has to use the surface info to process HIDE and RENDER and so on, so it has to be in the realm of the
possible. But I can't find it.
Michael Richmond
P.S. Oh ya, is there anyway to access the mouse coords in real time without "clicking" - possibly accessing the
"status bar" COORDS
==============
Control Template :
Ever get tired of making an exit button over and over? Do you use the same set up for multi page (or any
control) over and over? Save time, save effort. Make a control template!
1) Start with a New VBA Project in AutoCAD (or any VBA enabled application)
4) If the properties window is not visible, click properties on the View Menu
5) Make sure that the properties for the command button are being listed in the properties window, then
change the following items:
6) Caption = Exit
8) From the file menu choose close and return to AutoCAD (or whatever application you are setting up).
9) Close AutoCad, when prompted to save the changes to Global1 say "yes" (save it under any name, you will
open it right back up).
10) Restart AutoCAD and load the dvb file saved in step 7.
11) Drag the command button you customized in step 5 onto the controls tab of the Toolbox.
===========
(defun c:between ( / x y)
(command "_non")
);defun
(princ)
;CODING ENDS HERE
==================
Kenny,
Your Unload all function on your site won't run in MAP5, this will in case you ever need it.
(vl-load-com)
(setq acadapp(vlax-get-acad-object))
(setq vbe(vla-get-vbe acadapp))
Andy Canfield
============
========================
AUTOCAD LT 2004
================
http://www.belarc.com/
Just select the "Free Download" link and download the software. (about 660kb)
Displays a web page listing of all the hardware and software on your PC.
====================
===================================
As a general rule: always reset any system variables that were changed
them. A system variable should NOT be "reset" to any specific value, but it
This means grabbing the current value with GETVAR, saving it and setting it
variable. For example, OSMODE could be changed just before picking a point
In the case of CMDECHO, there's no need to change it unless you write code
that can echo back to the screen. If you do have echos and you don't want to
clutter the screen with it, you can save/change it in the beginning and
Even if you are only writing code for yourself, it is well advised to follow
this rule or maybe someday you will be cursing at your own routines.
Stig Madsen
==============
=============
A Dog's Prayer.
When we get to heaven can we sit on your couch? Or is it the same old story?
Why are there cars named after the jaguar, the cougar, the mustang, the colt, the stingray and the rabbit, but
not ONE named for a dog? How Often do you see a cougar riding around?
We dogs love a nice ride! Would it be so hard to rename the Chrysler Eagle the Chrysler Beagle?
If a dog barks his head off in the forest and no human hears him, is he still a bad dog?
When we get to the Pearly Gates, do we have to shake hands to get in?
Are there dogs on other planets or are we alone? I have been howling at the moon and stars for a long time,
but all I ever hear back is the Schnauzer across the street.
We dogs can understand human verbal instructions, hand signals, whistles, horns, clickers, beepers, scent
ID's, electromagnetic energy fields, and Frisbee flight paths. What do humans understand?
These are just some of the things I must remember (in order to keep my present living arrangements)
I do not need to suddenly stand straight up when I'm lying under the coffee table.
I will not roll my toys behind the fridge, behind the sofa or under the bed.
I must shake the rainwater out of my fur before entering the house.
I will not eat the cats' food before they eat it or after they throw it up.
I will stop trying to find the few remaining pieces of clean carpet in the house when I am about to get sick.
I will not throw up in the car.
I will not roll on dead seagulls, fish, crabs, possums, etc. just because I like the way they smell.
I will not munch on "leftovers" in the kitty litter box; although they are tasty, they are not food.
I will not eat any more Kleenex or napkins and then redeposit them in the backyard after processing.
I will not chew crayons or pens, especially not the red ones, or my people will think I am hemorrhaging.
When in the car, I will not insist on having the window rolled down when it's raining outside.
We do not have a doorbell. I will not bark each time I hear one on television.
I will not steal my mom's underwear and dance all over the back yard with them.
The sofa is not a face towel; neither are Mom and Dad's laps.
I will not play tug of war with dad's underwear when he's on the toilet.
I will not roll around in the dirt right after getting a bath.
Sticking my nose into someone's crotch is not an acceptable way of saying hello.
I will not come in from outside and immediately drag my butt across the carpet.
The toilet bowl is not a never ending water supply and, just because t the water is blue, that doesn't mean it's
cleaner.
I will remember that suddenly turning around and smelling my rear end can quickly clear a room.
The cat is not a squeaky toy so when I play with him and he makes that noise, it's usually not a good thing.
Love,
The Dog
=========
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
----------------------------------------------------------
http://www.BedrockBand.com
----------------------------------------------------------
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
Stats VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-04
=========================
28th May 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
This is an air conditioned environment.
Do not open Windows.
=========================
Pearls of Wisdom
===============
A belly button is for salt when you eat celery in bed.
===============
Here's a couple of answers I received in regards to the AutoCAD Configuration question I asked in the last
issue :
My configurations are pretty standard, and I feel 'common sensical', but I decided to reply in case you're short
on obvious replies....
I work as a CAD manager in a small Structural Engineering office in Australia. We have been using AutoCAD
since v1.7b in 1983. At work we only have 3 Acad seats which are configure (almost) identically. One seat is
LT+DRC-Toolkit, which can emulate our full seats. They are on a network, but each seat is self sufficient,
however, we do use shortcuts to shared block libraries and have one global library/backup area on the
network. We still like to only turn one machine on if there is only one person in the office ;-)
At home I moonlight for some Architectural designers and NEED four different CAD configurations.
- One vanilla for development and testing.
- One Structural Engineering (for overtime work)
- Two separate Architectural environments.
I simply have four icons on my desktop which launch each environment using profiles. I have a simple LISP
routine to control it and confirm that I am dropping in to the correct environment. Each has it's own Folder
with LISP routines, custom menus, fonts, linetypes, patterns and all relevant blocks that are used in that
environment.
AutoCAD itself gets installed as pure vanilla. The only customisation is to add my 'acaddoc.lsp' within its
support path. Each environment has it's Search File Paths and other options defined and saved as a named
profile in IT'S Folder.
Works for me ;-)
Rob Jackson
============
Ed Note : Rob did supply an example of his "bootstrap" routine, but unfortunately space is limited and I had
to exclude it. I will be talking to Rob in regards to publishing this section at a later date as it is quite
interesting.
============
Just a real quick one on the config front. The company I work for uses a program called Autosys to control
Regards
Dennis
=======
Coding
=======
Is it possible to record a list of the commands that I use during a session of AutoCAD in to a text file? I would
like it to be similar to the list of commands that you find under "Recent Commands" on the text line.
Peter
=====
Peter, you could not just switch on "Maintain a Log File" or try this out :
"Allclear Macro Recorder"
http://www.dczaland.com/
======================
Are you aware that the Visual LISP IDE can help you in finding erroneous code?
Check the item "Break On Error" in the DEBUG menu.
Load and run the LISP code with an error.
As expected, your program fails.
Now pick the item "Last Break Source" in the DEBUG menu.
The cursor takes you to the point of failure in the LISP code.
(Note: This may not work for complex errors - especially in any of my programs!!)
========
In response to Stig Madesens words of wisdom in regards to resetting system variables in last weeks
Newsletter, if you want to set many system variables programmatically, instead of using individual expressions
use these efficient and easily maintainable AutoLisp expressions to set and reset AutoCAD system variables.
Big Ed
=========
Hey Kenny,
I want to point to a directory on the network F:\\ctb, w/o having to make this change in tools/options and to
force the change if someone changes it to some place else. Is this possible?
Zain
=======
I "borrowed" this from somewhere.
Hi Kenny,
Is it possible through AutoLISP or other to change an attribute of a batch of drawings without manually doing
each one. Such as the revision in the title block.
Cheers,
Ryan
==========
And here's a couple of answers to a couple of questions compliments of Stig Madsen :
Is there anyway to access the mouse coords in real time without "clicking" - possibly accessing the "status
bar" COORDS?
Accessing mouse coordinates in real time can be done with GRREAD. You can do
all sorts of cool device tracking with GRREAD; find out if the mouse has
been moved, where it's been moved, if the mouse has been pressed, what key
has been pressed or if a pulldown menu has been accessed.
Here are two small commands to rattle on mouse locations. The first reports
the current location of the cursor and the second reports running movements
of the cursor until a key or the mouse is pressed:
We have a network and I want to attatch an XREF drawing from the server, when doing so I want all the
layers to be turned to the color red in order to differentiate between my work and the attached layers from
other departments.
To ensure that changes made to XREF's layers in the current drawing don't
get reset or, actually, reloaded next time the drawing is opened, set the
"Entering a phone number into the Google search engine will return a home address and a map with
directions to that address."
Or :
http://www.snopes.com/
====================
http://www.vbdesign.net/language.htm
http://grimpeur.tamu.edu/~colin/lp/
==============
The following are actual letters that Abigail Van Buren (Dear Abby) herself admitted she was at a loss to
answer:
Dear Abby,
A couple of women moved in across the hall from me. One is a middle-aged gym teacher, and the other is a
social worker in her mid-twenties. These twowomen go everywhere together, and I've never seen a man go into
their apartment or come out. Do you think they could be Lebanese?
Dear Abby,
What can I do about all the sex, nudity,language and violence on my VCR?
Dear Abby,
I have a man I never could trust. He cheats so much I'm not even sure this baby I'm carrying is his.
Dear Abby,
I am a twenty-three-year-old liberated woman who has been on the pill for two years. It's getting expensive,
and I think my boyfriend should share half the cost, but I don't know him well enough to discuss money with
him.
Dear Abby,
I suspected that my husband had been fooling around, and when I confronted him with the evidence he denied
everything and said it would never happen again.
Dear Abby,
Our son writes that he is taking Judo. Why would a boy who was raised in a good Christian home turn against
his own?
Dear Abby,
I joined the Navy to see the world. I've seen it. Now, how do I get out?
Dear Abby,
My forty-year-old son has been paying a psychiatrist $50 an hour every week for two-and-a-half years. He
must be crazy.
Dear Abby,
I was married to Bill for three months, and I didn't know he drank until one night he came home sober.
Dear Abby,
Do you think it would be all right if I gave my doctor a little gift? I tried for years to get pregnant and
couldn't, and he did it.
Dear Abby,
My mother is mean and short-tempered. I think she is going through her mental pause.
Dear Abby,
You told some woman whose husband had lost all interest in sex to send him to a doctor. Well, my husband
lost all interest in sex years ago and he is a doctor.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
=========================
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
"Corbimite.com"
http://www.corbimite.com
=========================
Important :
Press all the keys on your keyboard at the same time to continue...
=========================
==============
If you've popped into AfraLisp lately, you might be forgiven for thinking that not much is going on.
The reason being is that I'm busy with one of my major site updates and cleanups.
I should be finished by this weekend so, please be patient and don't yell at me as I can promise
you lot's of new content and maybe one or two surprises.
==============
++++SPECIAL++++
A collection of all the Visual Lisp Tutorials found on AfraLisp in PDF format.
Pearls of Wisdom
===============
===============
Coding
=======
Hi Kenny,
I'm a beginner at AutoLISP and right now I'm stuck, so I thought I'd seek help from a guru.
If (setq s3 (cdr (assoc 2 s2))) returns the value "circ" and (ssget '((2 . "circ"))) creates a selection
set comprising all the blocks named "circ" within my selection, why doesn't (ssget '((2 . s3))) do
the same thing?
If !s3 returns "circ", doesn't that make (ssget '((2 . "circ"))) the same thing as (ssget '((2 . s3)))?
I have been typing ALL at the 'select objects' prompt to make sure I am always selecting the same
objects.
When I use (ssget '((2 . s3))) I get the following error message - ; error: bad SSGET list value.
Lara Aigoro
==========
If both the DXF code and the desired value are know, the list may be quoted as you tried. BUT, if
either is specified by a variable, the list must be constructed using the "list" and the "cons"
functions.
This creates a selection set of all objects on the layer "STEEL" which is referenced in the variable
"layername".
===========
With this Math.lsp you can change any text or Mtext entites in preseted sequence , using basic
math operators via dialog box. For example H=1m H=2m H=3m ....
Zeev
=====
//DCL CODING STARTS HERE
//TextMath.dcl_13.3.3
//
tm : dialog {
:column {
:row {
:edit_box {
label = "To start with : ";
edit_width =4;
key="tpre";
:edit_box {
edit_width =4;
key="num";
:edit_box {
key="tend";
:row {
:edit_box {
edit_width =1;
key="func";
:edit_box {
edit_width =4;
key="inc";
ok_only;
(defun c:math ()
(setvar "dimzin" 8)
(if (not pre)(setq pre "prefix" num "1"
(action_tile "accept"
"(done_dialog)"))
(start_dialog)
(setq tset
counter 0 )
(entmod tent)
(command "regen")
(princ)
);end defun
=============
=============
Now save the drawing and then close AutoCAD and re-open the drawing.
The (acet-setvar) and (acet-getvar) pair of functions are a great resource for storing and retrieving
data in various places. These functions work particularly well for storing custom command
settings and information across editing sessions. You can store values with the current drawing,
the current profile, or in a general section of the registry.
Where:
[location] is an optional integer bit coded value. Location is the sum of one or more of the
following values:
NOTES:
i) If the location value is not provided then 2 is used as a default, resulting in the value being
stored with the current profile.
ii) List data and entity name data can only be stored in the dwg. Do not attempt to store list data or
an entity name using the current profile or fixed profile location flags.
iii) Some lists with nested dotted pairs cannot be stored using acet-setvar.
Where <varname> is the string name of the variable and [location] is the sum of one or more of the
bit coded values described above. If the optional location argument is omitted, the drawing will be
searched first, and then the current profile and then finally the fixed profile. The first location that
has the specified variable stored there will be used for the return value.
============
You should either unlock them or stop users from selecting objects on locked layers in the first
place. Try this :
(ssget ":L")
=============
By setting OSMODE to 0 you simply turn off each individual object snap (end point, middle, center
and so on). When you use F3, the bit code 16384 is added to turn the object snap FUNCTION off,
not the individual object snap's. By adding and removing this value you can turn on and off
running object snap without loosing your settings.
==============
Try this :
label = "Cursor" ;
: image_button {
width = 40 ;
height = 12 ;
color = -15 ;
key = "cur_img" ;
spacer_1;
: text {
width=10;
alignment=centered;
spacer_1;
ok_only ;
==========
==========
(defun c:cur()
(start_dialog)
(unload_dialog cur_id)
(princ)
);defun
;==========================
(start_image "cur_img")
(fill_image 0 0 xv yv 5)
(fill_image xv 0 xx yv 1)
(fill_image 0 yv xv yy 2)
(vector_image 0 yv xx yv 8)
(vector_image xv 0 xv yy 8)
(end_image)
);defun
(princ)
============
============
Kenny,
I am using LT2002 with LT-Extender (lisp enabler) but previously used full version 2000 and 2002
where I became almost reliant on the Extension osnap. LT 2002 does not have the extension osnap
as standard therefore my question is whether it would be possible to invoke this osnap (osmode
4096) in LT2002 using a lisp or arx routine in conjunction with the LT-Extender lisp generator?
Simon A. Baines
==============
========================
Hi Kenny,
Thanks for the newsletter and love the link to snopes.
http://www.snopes.com/humor/iftrue/chess.htm
While it didn't really happen playing chess, I am sure it will happen soon somewhere when
programming in .NET!
Thanks
Bill H
=====
Have fun with "MTJIGSTRING" and set it in a startup lisp to the name of the user or anything else.
===================================
To help you build global-friendly AutoLisp routines, have a look at the (undocumented) system
variable GLOBCHECK which is set off (= 0) by default. If you enable it (= 1), it will reject any
command or keyword input from scripts, menus or application sources that fails to use the
underscore prefix.
Set GLOBCHECK=1 while developing and debugging your program to make sure you catch all of
the pertinent strings.
If you set GLOBCHECK=3, it will display the size of a dialog box at the command line when
=========
http://www.adi-xz.com.cn/study/user/dev/user04.htm
=============
I met a Dutch girl with inflatable shoes last week, phoned her up to arrange a date but
unfortunately she'd popped her clogs.
Two Eskimos sitting in a kayak were chilly; but when they lit a fire in the craft, it sank, proving
once and for all that you can't have your kayak and heat it.
But I'll tell you what I love doing more than anything: trying to pack myself in a small suitcase. I
can hardly contain myself.
But I'm in great mood tonight because the other day I entered a competition and I won a years
supply of Marmite.........one jar.
Now did you know all male tennis players are witches, for example Goran, even he's a witch.
So a lorry-load of tortoises crashed into a train-load of terrapins, I thought "That's a turtle
disaster".
A priest, a rabbi and a vicar walk into a bar. The barman says, "Is this some kind of joke?"
A three-legged dog walks into a saloon in the Old West. He slides up to the bar and announces:
"I'm looking for the man who shot my paw."
A group of chess enthusiasts checked into a hotel and were standing in the lobby discussing their
recent tournament victories. After about an hour, the manager came out of the office and asked
them to disperse. "But why?" they asked, as they moved off. "Because," he said "I can't stand
chess nuts boasting in an open foyer."
There was a man who entered a local paper's pun contest. He sent in ten different puns, in the
hope that at least one of the puns would win. Unfortunately, no pun in ten did.
A woman has twins, and gives them up for adoption. One of them goes to a family in Egypt and is
named "Amal." The other goes to a family in Spain, they name him Juan". Years later, Juan sends
a picture of himself to his mum. Upon receiving the picture, she tells her husband that she wished
she also had a picture of Amal. Her husband responds, "But they are twins. If you've seen Juan,
you've seen Amal."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
http://www.BedrockBand.com
----------------------------------------------------------
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-06
=========================
11th June 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
All wiyht. Rho sritched mg kegtops awound?
=========================
==============
++++SPECIAL++++
For one week only!!!
"The AfraLisp DCL Tutorials"
A collection of all the DCL Tutorials found on AfraLisp in PDF format.
http://www.afralisp.com/books/DCL.zip (Download size: 1566 Kb)
Pearls of Wisdom
===============
A chicken is an egg's way of producing more eggs.
===============
Coding
=======
(defun c:prog1 (/ a)
(if (= gv nil)
(setq gv 1.0)
);end if
(setq a (getdist (strcat "\nEnter Distance <" (rtos gv) ">: ")))
(if (= a nil)
(setq a gv)
);end if
(setq gv a)
(princ "\nThe Distance is ")
(princ a)
(princ)
);defun
Don Ireland
==========
Regards,
Bill Storey
=========
It works for me. Try this at the command line :
Command: line
Specify first point: (btwn)
Then just choose your two points and the line will start from the
mid point between the two.
================
(setq MyReactor1
(vlr-miscellaneous-reactor
nil
'((:vlr-layoutSwitched . DoThisAfterLayoutSwitch)
)
)
)
(defun Clear_My_Reactors ()
(if (and MyReactor1 (vlr-added-p MyReactor1))
(vlr-remove MyReactor1)
)
)
Jesse
That DJ Guy
===========
CAD Encoding - The Journal is focused on helping you to improve your work
http://www.afralisp.com/newsletter/2003/2003-06.htm (5 of 8) [23/03/2005 05:49:07 p.m.]
AfraLisp Newsletter No 2003-06
environment with tutorials and working code examples written in, and for,
the most popular customizing languages for the major CAD software programs
and Microsoft Office products - Visual Basic for Applications, Visual Basic,
Visual C++, AutoLisp, Visual Lisp, and DCL :
http://www.cadencoding.com
And the following was sent with compliments from Mike Perry:
Man goes to the doc, with a strawberry growing out of his head.
Doc says 'I'll give you some cream to put on it'
Two cows standing next to each other in a field, Daisy said to Dolly
"I was artificially inseminated this morning."
http://www.afralisp.com/newsletter/2003/2003-06.htm (6 of 8) [23/03/2005 05:49:07 p.m.]
AfraLisp Newsletter No 2003-06
"I don't believe you," said Dolly
"It's true, straight up, no bull!"
A guy walks into the psychiatrist wearing only cling film for shorts.
The shrink says, "Well, I can clearly see you're nuts."
"So I got home, and the phone was ringing. I picked it up, and said
'Who's speaking please?'
And a voice said 'You are."
---------------------------------------------------------
http://www.afralisp.com/newsletter/2003/2003-06.htm (7 of 8) [23/03/2005 05:49:07 p.m.]
AfraLisp Newsletter No 2003-06
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Some People Will Listen to Anything!!
http://www.BedrockBand.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-07
=========================
18th June 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
No Parking!!
=========================
Pearls of Wisdom
===============
Half of the people in the world are below average.
===============
==============
++++SPECIAL++++
For one week only!!!
"The AfraLisp AutoLisp Tutorials"
http://www.afralisp.com/newsletter/2003/2003-07.htm (1 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
A collection of all the AutoLisp Tutorials found on AfraLisp in PDF format.
http://www.afralisp.com/books/AutoLisp.zip (Download size: 785 Kb)
Coding
=======
Rob
====
;Edistring routine
;
(defun editstring (VRAAG text / ltxt rtxt P L keyhit)
(textscr)
(setq P (strlen text))
(setq ltxt text)
(setq rtxt "")
(setq keyhit 1)
(prompt vraag)
(while (not (= keyhit 13))
(setq text (strcat ltxt rtxt))
(setq L (+ (strlen ltxt) (strlen rtxt)))
(setq ltxt (substr text 1 P))
(setq rtxt (substr text (1+ P) (- L P)))
(setq keyhit (cadr (grread)))
(if (and (> keyhit 31)(< keyhit 127))
(progn
(setq P (1+ P))
(if (not (= keyhit 8))
(progn
(setq ltxt (strcat ltxt (chr keyhit)))
(princ (chr keyhit))
)
http://www.afralisp.com/newsletter/2003/2003-07.htm (2 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
)
)
)
)
; (prompt VRAAG)
(princ (strcat ltxt))
)
(defun c:INPUT ()
(SETQ OT "")
(setq NT (editstring OT))
)
(DEFUN C:CH ()
; (SETQ BLOCKNAAM (GETSTRING "BLOCK - NAAM : "))
(SETQ TAG (GETSTRING "ATTRIBUTE TAG : "))
(SETQ OT "")
; (SETQ VRAAG "NIEUWE TEKST : ")
(SETQ NEWDATA (GETSTRING T "NIEUWTEXT : "))
(SETQ INDEX 0)
; VERSCHIL TOV CHATTR.LSP IS DAT DE EERST VOLGENDE REGEL KIJKT OF HET
; JUISTE BLOCK IS GEKOZEN, NU NIET NODIG, OOK DE VRAAG HIERNA WORDT DUS
; OVERGESLAGEN.
; (SETQ SSET (SSGET "X" (LIST (CONS 0 "INSERT") (CONS 2 BLOCKNAAM))))
(SETQ SSET (SSGET "X" (LIST (CONS 0 "INSERT") )))
;
(SETQ BLOCKTEL (SSLENGTH SSET))
(WHILE (>= BLOCKTEL 0)
(SETQ ENTT (SSNAME SSET INDEX))
(IF (/= ENTT NIL)
(ZOEKATTR ENTT TAG )
)
(IF (/= ENTTL NIL)
(PROGN
; (SETQ DATA (CDR (ASSOC 1 ENTTL)))
; (SETQ DATA NEWDATA)
(SETQ enttl (SUBST (CONS 1 newdata) (ASSOC 1 enttl) enttl))
(ENTMOD enttl)
; (ENTUPD entt)
)
(PROGN
(TEXTSCR)
http://www.afralisp.com/newsletter/2003/2003-07.htm (3 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
;; (PROMPT (STRCAT "RESTERENDE BLOKKEN = " (ITOA BLOCKTEL)))
)
)
(SETQ BLOCKTEL (- BLOCKTEL 1))
(SETQ INDEX (1+ INDEX))
)
(PRINC)
;----------------------------------------------------------------------
;
; (ZOEKATTR )
;
; Onderzoekt of entiteit een attribuut met de tag tagnaam heeft, en of
; de waarde daarvan gelijk is aan veldwaarde. Als de veldwaarde een lege
; string is wordt er niet op die waarde gecontroleerd.
;
; RETURN: Entity-list van het attribuut, als tagnaam en waarde kloppen
; Anders wordt een nil-list teruggegeven.
; ENTTL
; 22-3-90
;
;----------------------------------------------------------------------
(defun zoekattr (entt tag / gevonden test)
(setq
ENTTL (entget entt)
gevonden nil
)
(if
(and
(= (cdr (assoc 0 ENTTL)) "INSERT")
(= (cdr (assoc 66 ENTTL)) 1)
) ; als het een blok met attributen is
(setq
entt (entnext entt)
ENTTL (entget entt)
test (/= (cdr (assoc 0 ENTTL)) "SEQEND" )
)
(setq test nil)
)
(while TEST
; (if (and (= (cdr (assoc 0 ENTTL)) "ATTRIB")
http://www.afralisp.com/newsletter/2003/2003-07.htm (4 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
(= (cdr (assoc 2 ENTTL)) tag))
(if (and (= (cdr (assoc 0 ENTTL)) "ATTRIB")
(= (STRCASE (cdr (assoc 2 ENTTL))) (STRCASE tag)))
(setq gevonden T)
)
(if gevonden
(setq test nil)
(setq
entt (entnext entt)
ENTTL (entget entt)
test (/= (cdr (assoc 0 ENTTL)) "SEQEND")
)
)
)
(IF (= (cdr (assoc 0 ENTTL)) "SEQEND")
(SETQ ENTTL NIL)
)
ENTTL
)
;CODING ENDS HERE
=================
Hi Kenny,
In your last newsletter there was a LISP code to delete all points from a drawing.
Here is a shorter solution:
OR
Hi Kenny,
I read the last newsletter and there was something
about having an extra osnap for locating a point between
two other points. 'cal;mee works fine for two endpoints
but what'll you do when you want a point between an
intersection and a center?
The solution is acually quite simple :
'cal;(cur+cur)/2
'cal:(cur+cur)/3 or 'cal:(cur+cur)/4
You can't influence the point from where 1/3rd or 1/4th will be taken,
even if you pick the two points the other way round, you'll always get
the same result. For this purpose you'd better use
'cal;plt(cur,cur,0.333333) or
'cal;plt(cur,cur,0.25).
But with non-harmonic fractions like 1/3rd you'd introduce a roundoff error.
(the problems of the CAD-user are pretty huge huh?? LOL ;-))
I saw that a reader posted a LISP code to divide in 2, but that
routine only works in 2D and takes the Z-value of the first point.
The "'cal;(cur+cur)/2" thingie works in three dimensions.
Best regards,
Georges Bolssens
================
Will Deloach
===========
Hi Kenny ...
Here is a contribution to your methods enterprise
http://www.afralisp.com/methods/methods_ref.htm#H
) ;_ end of defun
;CODING ENDS HERE
Rob Kish
http://www.afralisp.com/newsletter/2003/2003-07.htm (8 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
=========
The 4th Annual New Jersey Autodesk Summertime CAD Show is now the
Northeast Regional Autodesk User Group Show. Two days of training,
vendor showcase and guest speakers (Lynn Allen of Autodesk, Ed Goldberg,
AIA and Jeanne Aahus).
The NRAUG Show will be held on August 6th and 7th at the Parsippany Hilton
in Parsippany, New Jersey. You don't want to miss this.
http://www.njaug.org/nraug.htm
Thomas E. Maleski
mailto:[email protected]
Program Director
New Jersey Autodesk User Group
http:\\www.njaug.org
To end any selected command without having to write code for every
possible option, just repeat (command PAUSE) until the command is ended.
(command "_ARC")
(while (= 1 (logand (getvar "CMDACTIVE") 1)) (command PAUSE))
* Innovative
* Preliminary
* Sorry, but you are not quite good looking enough for me
The Manchester United soccer players are in the dressing room on Saturday,
just before the game, when Roy Keane walks in.
"Boss," he says, "there's a problem.
I'm not playing unless I get a cortisone injection."
"Hey," says David Beckham. "If he's having a new car,
so am I."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Some People Will Listen to Anything!!
http://www.BedrockBand.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
http://www.afralisp.com/newsletter/2003/2003-07.htm (10 of 11) [23/03/2005 05:49:08 p.m.]
AfraLisp Newsletter No 2003-07
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-08
=========================
3rd July 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
This line is invisible to anyone with a higher IQ than me.
=========================
http://www.afralisp.com/books.htm
=============================
Don't say I'm not nice to y'all
=============================
And don't forget that AfraLisp now has it's very own "Knowledge Base".
http://www.afralisp.com/disc6_toc.htm
Coding
=======
Hi Kenny,
Georges Bolssens wrote that when using the 'CAL' function 'plt'
"non-harmonic fractions like 1/3rd ... introduce a roundoff error".
While this is true the way he has used it, you can easily overcome
that problem by simply using a fraction (actually division) as the
third argument
'cal;plt(cur,cur,1/3);
Jim Fisher
http://www.afralisp.com/newsletter/2003/2003-08.htm (2 of 12) [23/03/2005 05:49:10 p.m.]
AfraLisp Newsletter No 2003-08
=========
Kenny,
I was reading one of the Newsletters and read where someone was having
problems with a midpoint routine. I got some help on the one I use so
I will include it freely to help someone else. This routine works even
if you have osnaps set. I set mine to work in my osnap popup menu.
Will Deloach
===========
Hi Kenny
Great to see your newsletter back on the air. (I don't know how I
survived without it - it was a dark period!)
Before I get to my main point, thanks for your tip about the lisp
editing program Lisplink from www.caelink.com - I don't know how I
lived without it! Also, your readers may like to know that DOSLib
6.1 is now available.
Your tip to end any selected command without having to write code
for every possible option reminded me of something I discovered many
years ago. I wanted my lisp program to insert a drawing (which
contained a library of blocks) into my current drawing without
actually placing it on the drawing so that the blocks contained within
(xsfind is a function which returns a selection set of all the inserted Xrefs.)
Craig Green
Any electrical darfties out there? have some simple AutoLISP routines
Timmo
mailto:[email protected]
========================
Hello,
Nate
=====
Hello,
Thanks,
Kelley
======
Hi there,
Regards,
Edin
mailto:[email protected]
===================
Would you like to strip all the white space out of your AutoLisp coding?
Open a new file in Notepad and add these lines :
<HTML>
<HEAD>
<TITLE>Strip White Space</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Now add you code between the <BODY> and </BODY> tags :
<HTML>
<HEAD>
<TITLE>Strip White Space</TITLE>
</HEAD>
<BODY>
(vl-load-com)
(princ)
);defun
(princ)
</BODY>
</HTML>
Nice web site. If you are interested you can link to my unofficial AutoCAD
history site and also the command and system variables documents.
http://betaprograms.autodesk.com/history/autocad_release_history.htm
Shaan Hurley
mailto:[email protected]
"Vmyths"
The Truth About Computer Virus Myths & Hoaxes
http://vmyths.com/
Stage 1 - CLEVER
This is when you suddenly become an expert on every subject in the known universe.
You know you know everything and you want to pass on your knowledge to anyone
Stage 2 - ATTRACTIVE
This is when you realise that you are the most ATTRACTIVE person in the entire
bar and that everyone fancies you. You can go up to a perfect stranger knowing
that they fancy you and really want to talk to you. Bear in mind that you are
still CLEVER, so you can talk to this person about any subject under the sun.
Stage 3 - RICH
This is when you suddenly become the RICHEST person in the room.
You can buy drinks for the entire bar because you have a bottomless wallet.
You can also make bets at this stage, because of course you are still CLEVER so,
naturally, you will always win. Anyway, it doesn't matter how much you bet
because you are RICH. You will also buy drinks for everyone that you fancy,
in the knowledge that you are clearly the most ATTRACTIVE person present.
Stage 4 - INVINCIBLE
You are now ready to pick fights with anyone and everyone, especially those
with whom you have been betting or arguing. This is because you are now INVINCIBLE.
At this point you can also go up to the partners of the people who you fancy and
challenge them to a battle of wits or strength. You have no fear of losing this
battle, because as well as being INVINCIBLE you are CLEVER, you're RICH and
you're more ATTRACTIVE than they are anyway.
Stage 5 - INVISIBLE
This is the final stage of drunkenness. At this point you can do anything,
because you are now INVISIBLE. You can dance on a table to impress the people
who you fancy because the rest of the people in the room cannot see you.
You can also snog the face off them for the same reason. You are also INVISIBLE
to the people who want to fight you. You can walk through the street singing at
the top of your lungs because no one can see or hear you , and because you're
still CLEVER you know all the words.
Stage 1 - STUPID
As you regain consciousness and begin to enjoy the headache, the churning
stomach and the cold sweats, you realise that you have lost not only several
hours of your life but also the ability to concentrate on anything whatsoever.
You are now STUPID and will remain so for a minimum of 12 hours.
Stage 3 - POOR
Having crawled out of bed and got dressed you are about to shamble out the
door when you discover that the money that was to last you the week is now
missing from your wallet. Being STUPID, you have no idea what happened to it
but the traces of curry on your clothes allow the possibility that you might
have treated everyone to a takeaway at some point. Alternatively your pocket
could have been picked or you might have given the taxi driver £150 by mistake.
Rationalising that you couldn't possibly have been that STUPID and that you
would remember being robbed, you come to believe that you were the only one
who bought any food or drinks all night and start to loathe all your friends.
Stage 4 - FRAGILE
As you are now STUPID, UGLY and POOR, your consequently FRAGILE self-esteem,
plummets. Your already FRAGILE physical condition ensures that you feel liable
to shatter if anyone even speaks to you.
Stage 5 - CONSPICUOUS
This is the final stage of sobering up. Unfortunately, everyone can spot this
CONSPICUOUS condition and its cause from a great distance. Even worse, they
know that they can complete your misery by making fun of you, and that you
are too STUPID to retaliate, too FRAGILE to hit them, too POOR to bribe them
and too UGLY to hide.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-09
=========================
Wednesday 9th July 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Meow... SPLAT...
Ruff... SPLAT...
Hey, it's raining cats and dogs.
=========================
Funnily enough, he lives in the same town in New Zealand as my brother does. So,
Eddie will be popping around to :
1) Make sure he's a student, and
2) Make sure that he keeps me in mind when he qualifies and starts to earn money.
Although, being a New Zealander, I should be about 90 when that occurs!!!
===========
If you have any wishlist items that you would like to suggest, just send them to
me written on the back of a $10 note.
Pearls of Wisdom
===============
Gather 'round like cattle and ye shall be herd.
===============
Contents :
http://www.afralisp.com/mylisp.htm
Coding
=======
Kenny
Where:
c:/path/ = the required drive and search path
image.tif = is the required image to load (could be tif, bmp, jpg etc)
0,0 = location to insert on drawing
1 = scale
0 = rotation
Regards
Craig Green
===========
Hello Kenny,
I have tried replacing defun C: with defun-q: but it doesn't work. I made
sure I included (vl-load-com). The file wasn't compiled. I simply typed
the code in a text editor and saved it as an lsp file as I would with standard Autolisp.
Thanks
Lara
=====
(defun-q MYSTARTUP ()
);defun-q
Thanks,
Andrew C. Millard
===============
Kenny
The line spacing for mtext appears to always default to "At least". Is
there a way to force the default to "Exactly"?
Regards
Craig Green
===========
1 32.3 33.4
http://www.afralisp.com/newsletter/2003/2003-09.htm (5 of 9) [23/03/2005 05:49:11 p.m.]
AfraLisp Newsletter No 2003-09
1A 35.0 56.7
B 28 45
It is easy to extract the first element of each line, but I need then to
identify it as a integer, a real or a string, in order to apply ITOA or RTOS
in the first two cases to convert it to a string, and then use PRINT.
I have tried to use TYPE to identify the class of each element ; for
example, with the variable xx
(if
(= INT (TYPE xx))
(print "\nxx is an integer")
)
Thanks
Rogelio Bravo
============
Rogelio,
then
The following code example uses the type function on the argument passed to it:
http://www.afralisp.com/newsletter/2003/2003-09.htm (6 of 9) [23/03/2005 05:49:11 p.m.]
AfraLisp Newsletter No 2003-09
BT
====
and keyboard :
space=pause
enter=restart
Y=cheers
4=geyser.
If you need to run the dialog version of the PLOTSTAMP command even
in your script files, menus and LISP applications, use its undocumented
version _DDPLOTSTAMP.
================
http://www.afralisp.com/newsletter/2003/2003-09.htm (7 of 9) [23/03/2005 05:49:11 p.m.]
AfraLisp Newsletter No 2003-09
Do you want to have a textual list of current Xrefs used in your drawing?
Use the RTEXT command (Express Tools) and enter the Diesel expression:
When you attach or detach a Xref, just regen your drawing to update the list.
The tribal wisdom of the Dakota Indians, passed on from one generation to the
next, says that when you discover you are riding a dead horse, the best strategy
is to dismount.....
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
A Rock 'n Old Band.
http://www.BedrockBand.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-10
=========================
Wednesday 16th July 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
.sdrawkcab daer osla nac uoy ,hhA
=========================
Anyway, want I meant to say was, yes, please feel free to send me any
material that you feel should be published to a bunch of discombobulated,
in the mental sense, readers. You are never too old, or too young,
to try something new.
Remember, old draughtsmen don't die, they just draw too an end!!!
Hi Kenny
Cheers, Mike
===========
I must also mention that we had slight problems with the AfraLisp site towards
the end of last week and over the weekend whilst changing over to new servers.
I apologise for any inconvenience. Everything now seems to be up and running
and working well - fingers and toes crossed!! Thanks Frank.
Pearls of Wisdom
===============
I Xeroxed a mirror, now I have an extra copier.
Coding
=======
Hi Kenny,
Re: The line spacing for mtext appears to always default to "At least".
Is there a way to force the default to "Exactly"?
1 = At Least
2 = Exactly
Cheers, Mike
===========
I have written a function called "sri" which returns "STR" "INT" or "REAL"
depending upon whether the argument passed to the function is a string,
an integer or a real number.
As noted in the code, the method I have used for checking whether a number
is a real or an integer, is a bit crude because it will report numbers like
1.0 as integers. Others can improve on this if they like.
To test the code, load it into AutoCAD and type:
(sri "1")
(sri "1A")
Regards
Craig Green
I'm looking for some help. How can I change the width factor
of text (via VBA) that has been added to a drawing? Can that
property be set prior to adding the text or would I need to
Keith Whitfield
=============
If you can use text instead of mtext then you could do the following:
Sub TextWidth()
Height = 5
InsertionPoint = ThisDrawing.Utility.GetPoint
MyText.ScaleFactor = 5
MyText.Update
End Sub
Joe
====
How does one obtain the secrets to the acetutil2,3 and 4.fas files.
I have acetutil.lsp, but I am looking for explanations and/or coding
for the following commands:
acet-ucs-cmd
acet-viewport-next-pickable
acet-currentviewport-ename
I am guessing that they are located in the above mentioned "fas" files.
Any help?
Thanks,
Andrew C. Millard
===================
manjula
=======
Dear Sir,
Could you please tell if there is a way of joining two autocad arcs,
or two polylynes into one polyline, through vb, not by lsp.
Thank you
Best regards,
Solom Cornel
=============
Often menu macros should act differently depending on the active command.
The CMDNAMES variable can be used to detect the running command, if any.
This macro checks whether any command is active. If not, it turns the
running osnap off. If a command is active, the running osnap is
overwritten by "none" for the next input only:
[OSnap off]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;0,_none)
In a similar way you can turn on or override any running object snap mode.
Use the and and xor functions to evaluate the OSMODE system variable:
[$(if,$(and,1,$(getvar,osmode)),!.)Endpoint snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,1,$(getvar,osmode)),_end)
[$(if,$(and,2,$(getvar,osmode)),!.)Midpoint snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,2,$(getvar,osmode)),_mid)
[$(if,$(and,4,$(getvar,osmode)),!.)Center snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,4,$(getvar,osmode)),_cen)
Just a thought!!!
=============
To retrieve it type :
(getenv "Temp")
Start a new drawing and try and retrieve it again. Still there!
Close and re-open AutoCAD and retrieve it again. Still there!!!!!
Engineering Tools
http://www.augafrica.com/docs/softech_engtools.exe
Understanding Engineers
=====================
Submitted by Michael Perry
Two engineering students were walking across campus when one said,
"Where did you get such a great bike?"
************
************
The doctor chimed in, "I don't know, but I've never seen such ineptitude!"
The pastor said, "Hey, here comes the greens keeper. Let's have a word
with him." "Hi George! Say, what's with that group ahead of us?
They're rather slow, aren't they?"
The greens keeper replied, "Oh, yes, that's a group of blind firefighters.
They lost their sight saving our clubhouse from a fire last year, so we
always let them play for free anytime."
he group was silent for a moment. The pastor said, "That's so sad. I
think I'll say a special prayer for them tonight."
The doctor said, "Good idea. And I'm going to contact my ophthalmologist
buddy and see if there's anything he can do for them."
************
************
************
The last one said, "Actually it was a civil engineer. Who else would
run a toxic waste pipeline through a recreational area?"
************
************
The architect said he enjoyed time with his wife, building a solid
foundation for an enduring relationship.
The artist said he enjoyed time with his mistress, because of the
passion and mystery he found there.
************
An engineer was crossing a road one day when a frog called out to him
and said, "If you kiss me, I'll turn into a beautiful princess."
He bent over, picked up the frog and put it in his pocket. The frog spoke
up again and said, "If you kiss me and turn me back into a beautiful
princess, I will stay with you for one week."
The engineer took the frog out of his pocket, smiled at it and returned
it to the pocket. The frog then cried out, "If you kiss me and turn me back
into a princess, I'll stay with you and do ANYTHING you want."
Again the engineer took the frog out, smiled at it and put it back into
his pocket. Finally, the frog asked, "What is the matter? I've told you
I'm a beautiful princess, and that I'll stay with you for a week and do
anything you want. Why won't you kiss me?" The engineer said,
"Look, I'm an engineer. I don't have time for a girlfriend,
but a talking frog, now that's cool.
************
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Some People Will Listen to anything.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-11
=========================
Wednesday 23rd July 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Slippery when wet.
(so is mine!!)
=========================
I'm also busy converting the AfraLisp Tutorials to HTML Help format.
Anyone interested? If you are, drop me a line and I'll send you the
download link.
Pearls of Wisdom
===============
Above all else -- sky.
===============
***New on AfraLisp***
By Stig Madsen
Coding
=======
(setq cnt 1)
(repeat 8
(setq lp lc)
(setq lp (@r lp vh32))
(grdraw lp (setq lp (@u lp vh16)) cnt)
(grdraw lp (setq lp (@r lp vh16)) cnt)
(grdraw lp (setq lp (@d lp vh16)) cnt)
(grdraw lp (setq lp (@l lp vh16)) cnt)
(setq lc (@u lc vh))
(setq cnt (1+ cnt))
)
(setq y (getvar "viewsize")
sz (getvar "screensize")
ct (getvar "viewctr")
pt (getpoint "\nSelect Layer : ")
nlist (- (cadr ct) (/ y 2.0))
npnt (- (cadr pt) nlist)
If you activate a command and that command has command line options, you can
right click and have those options appear on screen. Where is this info
being pulled from? I know how to modify the various POP menus inside of the
acad.mnu file for context sensitive objects, but I can't find where these
non-object menus live. I am specifically trying to locate where the right
click menus for real time pan/zoom live. Any help would be greatly
appreciated.
Jeff
====
(princ)
);defun
(princ)
[Circle/Rectangle/Line]
You could also just "design" your own right click menu :
http://www.afralisp.com/vba/vbamenu2.htm
Happy??
========
Kenny
=======
Andrea Costamagna
=================
...Bill
=====
...Bill
======
(defun test()
(setq count 0)
(princ "\nWait. Program is busy...")
(while (< count 100000)
(setq count (1+ count)))
(princ "\nCounted: ")
(princ count)
(princ)
/n. Explorer always opens a new window, even if the specified folder
is already open (see the /root switch).
/root,object. This specifies the object to use as the root in the Tree pane.
By default, the desktop is the root object. To open an explorer view of only
one folder on a disk, specify the drive letter and folder path in place of
object.
To open Explorer with only the Windows directory displayed, for example, use
/root,c:\windows for this option.
/select. This option specifies that the parent folder specified by the
/root option is opened. If you also include the subobject option, Explorer
selects the specified object in the Contents pane but does not open the object.
To open \Windows as the root with the Command folder selected but not opened,
use the command line :
Explorer /e,/root,c:\windows,/select,Command.
Explorer /e,/root,c:\windows,Command.
PIRS On Line
http://www.insa.com/files.shtml
File Library
http://www.cadresource.com/library/index.html
=====================
As she was unloading her items on the conveyor belt to check out,
a drunk standing behind her watched as she placed the items in
front of the cashier.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Some People Will Listen to anything.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-12
=========================
Wednesday 30th July 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
H lp! S m b d st l ll th v w ls fr m m k yb rd!
=========================
Pearls of Wisdom
===============
Thesaurus: ancient reptile with an excellent vocabulary.
===============
You can download the "Enhanced Express Tools 2004 Menu" from here :
http://www.afralisp.com/lisp/express.htm
You can also download the "Enhanced Express Tools 2002 Menu" if you wish :
http://www.afralisp.com/lisp/express2002.htm
=================================
Coding
=======
The DCL Coding shown below is the typical syntax for an edit box :
: edit_box {
label = "some_label";
allow_accept = true_or_false;
width = tile_width;
edit_width = length_of_edit_box;
edit_limit = edit_limit_of_edit_box;
key = "key_name_for_driving_source_access";
mnemonic = "alt_key_for_easy_jump";
}
TRAJ2 : dialog {
label = "Conveyor Trajectory";
: edit_box {
label = "&Velocity (m/s)";
key = "VEL";
edit_width = 5;
allow_accept = true;
}
: edit_box {
label = "&Radius of Pulley (m)";
key = "RA";
edit_width = 5;
allow_accept = true;
}
: edit_box {
label = "&Angle of Incline";
key = "INC";
edit_width = 5;
allow_accept = true;
}
: edit_box {
label = "&Depth of Material (mm)";
key = "DEP";
edit_width = 5;
allow_accept = true;
}
ok_cancel ;
:text_part {
label = "Designed and Created";
}
:text_part {
label = "by Kenny Ramage";
}
}
(defun C:TRAJ2 ()
(setq V 1.5
);if
(princ)
);defun
(princ)
;CODING ENDS HERE
Save this as TRAJ2.LSP. Now load and run it. A dialog should appear.
Change any of the values in the edit boxes.
Now, whilst still in the edit box, press your "Enter" key.
The dialog closes and the rest of the program runs.
When you press the "Enter" key, because the edit box
tiles attribute "allow_accept" is set to "true", the coding for the
tile which has the attribute "is_default" (the "OK" tile) is triggered.
map : dialog {
: image_button {
key = "grid";
aspect_ratio = 0.5;
width = 30;
color = -15;
ok_only;
(Exit))
(Setq
(End_Image)
(Setq
(Start_Image key)
(Setq n 0)
(Setq n 0)
(End_Image)
(princ)
;;; LOADDCL.LSP
;;; Loads, displays, activates and unloads a dialog box of
;;; the same name. Used to verify dialog box design.
(progn
(start_dialog)
(unload_dialog DCL_ID)
);;progn
(alert
);;if
(princ)
(princ)
CDGPurge
=========
Ever get drawings from outside sources that are full of layer filters,
page setups or layerstates? What about the junk you can't see,
like registered applications? You might be surprised at the amount
of "leftovers" a third party program may leave behind. CDG Purge
will purge items that the standard AutoCAD command won't - including:
Registered applications
Named layer filters
Layer States
Page Setups
Empty Groups
http://www.caddevelopmentgroup.com/Downloads.htm
=============================================
http://www.cadencoding.com
========================
He felt renewed strength pulsate through his body. The aged and withered
hand trembled on its way to one lone biscuit at the edge of the table,
when..........
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If we are too loud, you are too old.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-13
=========================
Wednesday 6th August 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
printf("To C or not to C...that is the question\n");
=========================
Pearls of Wisdom
===============
If one synchronized swimmer drowns, do the rest drown, too?
===============
Coding
=======
Rick France
==========
Ooooh, that's a good one...........
Anyone care to enlighten us with an answer to this?
==========
Hello,
I have been trying to find out on how to just check if a certain block
(which I know its name) is already on a drawing or not. I am not sure, but I
was hoping you can help me with that. I have been reading your help files on
the internet, but I still could not put a routine (lsp) to check if a block
is already there.
I know I can check by typing a "rename" and see it there, but I wanted an
auto lisp routing so I can avoid the "redefine" block option when you create
a new block.
I would greatly appreciate any help from you. Thank you very much in
advance...
==========
Ahmed,
Hey Kenny~
I was customized a button. But when I re-loaded it, It came up a smiley face.
So I tried the copy from acad.mns method, and pasted that section into the
.mnu file. but, when I re-load acad the button continues to come up a smiley face.
I think it is taunting me! Thanks for your help!! Maybe I should just make a
custom menu and load that....
Brian
======
The easiest way to get around this problem is to create yourself a partial menu
and a toolbar DLL. You can find step by step instructions on how to go about
doing this here :
http://www.afralisp.com/vbaa/vbadll.htm
================
Now pick the circle. AutoLisp should return something like this:
Hey, Hang about. It's returned the entity list of the circle even
though it's part of a block!! Now type the following:
This HTML Code will allow you to open a Lisp file from a web page :
<html>
<head>
<title>Open Lisp Document</title>
<SCRIPT LANGUAGE=javascript>
<!--
function openLisp(theElement)
{
var Shell = new ActiveXObject("Shell.Application");
return Shell.ShellExecute(theElement.innerText);
}
//-->
============
Put this in your AcadDoc and you can toggle your Middle Button :
A grouchy old man goes to the doctor for a physical. Naturally, his grouchy
old wife goes with him.
The man's ears, like most everything else, are not what they used to be so
his wife is along to hear for him.
The doctor does his usual work and then sits down with the two of them.
Doc says to the old man "To complete my examination I'll need three more
things. A blood sample, a urine sample and a stool sample."
The old man says "WHAT?"
His wife says to him "He wants your underpants."
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If we are too loud, you are too old.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-14
=========================
Tuesday 12th August 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Please remove your shoes before reading further.
=========================
Scripting Objects
==================
by Stig Madsen
Pearls of Wisdom
===============
If Wile E. Coyote had enough money to buy all that Acme crap,
why didn't he just buy dinner?
===============
Coding
=======
Answers to:
I've got an answer. I'd don't know if it's the best answer though.
I used the shell command to do it. If you try to save the drawing,
it won't let you. Try it out.
A couple of flaws:
1. After running the command, it doesn't tell you in the AutoCAD
titlebar that it's in read-only mode. The drawing would have to
be re-opened for "-Read Only" suffix to appear.
2. If the drawing is brand new and hasn't been saved as anything,
it doesn't work. The drawing needs to be saved as a drawing file
before this will work.
Steve Mattingly
===========
Morning Kenny,
If ThisDrawing.ReadOnly Then
MsgBox "Autocad opened this file as read only." & Chr(10) & _
"The attribute Read-Only tag will be set."
Else
MsgBox ThisDrawing.FullName & " read only attribute set "
End If
End Sub
I went to the help again and in the example I only had to add
one line and it works. This is the code I was thinking about.
Now it would only have to be embebded.
Sub Example_AcadApplication_Events()
' This example intializes the public variable
'(ACADApp) which will be used ' to intercept
'AcadApplication Events
'
' The VBA WithEvents statement makes it possible
'to intercept an generic object with the events
'associated with that object.
'
' Before you will be able to trigger any of the
'AcadApplication events, ' you will first need to
'run this procedure.
End Sub
Tom
====
Hi Kenny,
Michael C. Pamatmat
==================
Michael,
To achieve this, you would have to have a look at reactors,
and to be specific, object reactors. Have a look at this tutorial :
http://www.afralisp.com/vl/reactors3.htm
This should be a good starting point for you.
=============
Dear Kenny,
Thank you.
Sebastião
=========
(= T (listp var))
HotKeys
By Chuck Gabriel
http://www.cadencoding.com//modules.php?
op=modload&name=Downloads&d_op=viewdownloaddetails&lid=18
A Freudian slip is when you say one thing but mean your mother.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Take off your shoes and hum along with us.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-15
=========================
Tuesday 19th August 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
If anybody can think of an English word that rhythms
with "purple", they are very, very clever.
=========================
This week was not only a wee bit cold, it also rained!!
Hey, 19mm in two nights. That's more than our annual rainfall.
At least it made it easier for my wife to pick up my beers bottle 'cos
normally I just chuck them out of my study window and she deals
with them whilst she's picking up the dog turds, and the remains of
dead cats that the dogs have got, and would be burglars that I have
got etc, etc. Because of the rain though, she's had it bloody easy 'cos
everything washed down into the pool which means that whilst she's
scooping out the leaves and twigs and dead frogs, and cats that
can't swim, and the next-door-neighbours-kids-that-can't-swim, she can
also deal with the rest of the rubbish at one time. Which makes me
pleased 'cos I like things neat and tidy around where I live.
Don't you agree?
Pearls of Wisdom
===============
Did you ever notice that when you blow in a dog's face,
he gets mad at you, but when you take him on a car ride,
he sticks his head out the window?
===============
Coding
=======
Kenny,
Thanks for the great newsletter. I always learn something and get a
smile from it.
I have a little routine here that draws isocircles in response to
Sebastião's question in the last letter.
Cheers,
David Blackmon
aka SomeCallMeDave
===================
For example, wanna know how many lsp files you have?
Command: SEARCHFOR
Start in folder: C:\\ACAD2004
File to search for: *.lsp
C:\ACAD2004\Sample\Database Connectivity\CAO\caotest.lsp
C:\ACAD2004\Sample\VisualLISP\activex\vla-tst.lsp
C:\ACAD2004\Sample\VisualLISP\External\propagate.lsp
C:\ACAD2004\Support\sample-profile-util.lsp
C:\ACAD2004\Tutorial\VisualLISP\Lesson1\gpmain.lsp
C:\ACAD2004\Tutorial\VisualLISP\Lesson2\gpmain.lsp
7 files found
Stig Madsen
============
;***ERROR HANDLING***
(defun dirtxterr (s)
(if (/= s "Function cancelled")
; If an error (such as CTRL-C) occurs
(princ)
(princ (strcat "\nError: " s))
; while this command is active...
(defun c:dirtxt
(/ olderr source winpath cnt 2cnt src sing_char dospath)
(setq olderr *error*
;Save old *error* handler
*error* dirtxterr
) ;Set new *error* handler
(setq source (getfiled "PICK FILE TO GET PATH"
(getvar "DWGPREFIX")
"*"
16
)
)
(princ)
(setq winpath source
dospath source
)
;***STRIP FILENAME FROM END OF STRING***
(while (/= "\\" (substr winpath (strlen winpath) 1))
(setq winpath (substr winpath 1 (- (strlen winpath) 1)))
) ;while NOT \
;***STRIP FILENAME FROM END OF STRING***
) ;while
(setq dospath (strcat dospath "\""))
; PUT DOUBLE QUOTES AROUND FOLDER NAMES AND FILE NAME
(setq ap "AM"
cd (rtos (getvar "CDATE") 2 4)
mx (atoi (substr cd 5 2))
hr (atoi (substr cd 10 2))
mn (substr cd 12 2)
mo (nth mx
'(nil "JAN"
"FEB" "MAR"
"APR" "MAY"
"JUN" "JUL"
"AUG" "SEP"
"OCT" "NOV"
"DEC"
)
)
) ;setq
(if (>= hr 12)
(setq ap "PM")
)
(if (>= hr 13)
(setq hr (itoa (- hr 12)))
(setq hr (itoa hr))
)
(setq yr (strcat "DATE: "
mo
" "
(substr cd 7 2)
", "
(substr cd 1 4)
)
)
(setq tm (strcat winpath " " yr " TIME: " hr ":" mn " " ap))
(write-line tm out_unit)
(write-line "" out_unit)
(close out_unit)
(command "SHELL"
(strcat "DIR " dospath "*.*/B/A:-d/O:n>>" dospath "DIR.TXT")
)
Kenny,
CATNO (007-0027)
DESCRIPTOR (U1)
QTY (This would be a tally of the total amout of CATNO found on the
drawing that match each other)
DESCRIPTION (74HC273)
MFG (PHILIPS MOTOROLA)
MFG_CATNO (74HC273N MC74HC273N)
I want to thank you for your help in this matter. I have enjoyed reading
your online newsletters and have downloaded several codes from your
site. You are the only one I could think of who would know how to find a
solution to my problem.
Thank You
Mark Ruble
============
I would always get mad when someone would close a drawing and
not zoom it back out. I worked on a lot of big projects and sometimes would
have 15 tab of drawings.
This little gem will go through each tab, zoom out and do a Qsave.
It's also good to use if you are going to email someone your DWG's
See ya
John Michael Hivatal
Did you know that the AND function returns NIL if any of its arguments
are NIL, otherwise it returns T. The OR function returns T if any of its
arguments are T, otherwise it returns NIL.
Reading this carefully explains why, with no arguments, (and) is T,
but (or) is NIL.
This is true, I think.
And this???
(and (or))
Returns nil
Or :
(or (and))
Returns T
By the way, NOT returns T if its argument is NIL; and returns NIL if its
argument is T.
Huh!!
======
Kenny,
A note about your comments regarding the listp function. Nil is
considered a list, so (listp nil) will return T. I don't know about
others, but this one I didn't expect.
Mike Weaver
===========
Try this :
(setq b nil)
Returns: nil
(listp a)
Returns: T
Yep, it's a list.
(listp b)
Returns: T
Mmm, so you were right Mike, "nil" is also a list.
But.......
(boundp 'a)
Returns: T
It must contain something?
(boundp 'b)
Returns: nil
Now we know it's truly empty, although still a list.
Interesting hey??
But, before you run off crying for your Mother,
(boundp 'anotherlist)
Returns: nil
(listp anotherlist)
Returns: T
"Cam Studio"
============
Other than being one of the best screen capturing applications
I've used, this magic program will also produce Streaming Web
Format files.
What the SWF Producer basically does is to convert AVI files to Flash
(.swf) files. It can convert almost all AVI files to Flash, including
those not produced with CamStudio.
http://www.rendersoftware.com/products/camstudio/index.htm
Therefore..........
(setq total (mapcar '+ list1 list2))
Would return : (5.5 7.7 9.9)
(setq pt3
(mapcar '+ pt1
(mapcar '/
(mapcar '- pt2 pt1)
'(2.0 2.0 2.0)
)
)
)
);defun
(princ)
;CODING ENDS HERE
==============
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Rock 'n Roll is Here to Stay!!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-16
=========================
Tuesday 26th August 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
For Sale!!
Morning after pill for men.
It changes your blood type.
=========================
Firstly you need an aim - you need to know what you are trying to write.
Rock album, Layer Manager, Country song, Drawing Setup routine????
Which brings me to the answer to your first question which you haven't
yet asked, but I know you will ask if I let you get a word in edgewise.
What is "Pre-Production" Kenny?
COND vs IF
==========
Written by David Hoekstra
Pearls of Wisdom
===============
The Earth is 98% full. Please delete anyone you can.
===============
Coding
=======
TIA,
Jeff Berg
==========
Hi Kenny,
Here is an AutoLISP routine LBEND2.LSP in which I
first added a DCL interface, thanks to you.
You can put it on your site if you like.
Thanks once again.
KongYik
lbend2 : dialog {
label = "LOBSTER_BENDS 2" ;
:row {
:column {
label = "Pipe dia" ;
: popup_list {
label = "DN";
key = "dlb";
value = 5;
edit_width = 6;
}
: edit_box {
label = "OD";
key = "deb";
is_enabled = false;
edit_width = 7;
}
: toggle {
label = "user_defined";
key = "drb";
}
} //column1
:column {
label = "Bend_radius" ;
: popup_list {
label = "Factor";
key = "rlb";
value = 3;
edit_width = 6;
}
: edit_box {
label = "Radius";
key = "reb";
: toggle {
label = "user_defined";
key = "rrb";
}
} //column2
:column {
label = "Mitre numbers" ;
: popup_list {
label = "No";
key = "mlb";
value = 4;
edit_width = 6;
}
: edit_box {
label = "No";
key = "meb";
is_enabled = false;
edit_width = 7;
}
: toggle {
label = "user_defined";
key = "mrb";
}
} //column3
} //row
: row{ //label = " ";
: text {
label = "Select centre point of bend and two angles";
ok_cancel;
} //dialog
;;;KYBOEY PIPING
;;;Lobster_Bends2
;;;Mitre bends-selected & user's input
;;;16/07/2 9:58PM
;;27/01/3 11:02PM
;|
Draw lobster bends radially from the centre of the radius
by providing the angles of the bends from the first angle
to the second angle but avoid using 0(zero) for the second
angle.
Selected input from lists are for radius times norminal dia.
of pipes.
And drawn radially between the two angles counter-clockwise
starting at 0deg.
(User input uses dimensions as supplied. Diameter=as a real,
Bend_radius=as a real, Mitre_numbers=as an interger & decimals
are ignored.
Non numbers are disallowed and re-input are requested.)
My endeavour is to draw most graphics in polyline, so moving
and deleting will be easier, hence some of the lines overlap.
Everything are done in haste so lookout for the bugs!
Program by Kong Yik Boey
Comments and suggestions are always welcome.
Send to "[email protected]"
(defun c:lbend2 ( / dcl_id dlbl rlbl mlbl dlbp rlbp mlbp debp
rebp mebp x y pnt1 an1 an2 rad0 rad1 rad2
pipedia mitrenum segment hsegment
p1 p2 p3 p4 pt1 pt2 pt3 pt4 ptl count smode
pipesizes radiuses userclick)
(setq dlbl '(" " "100" "150" "200" "250" "300" "350" "400" "450"
"500" "550" "600"))
(setq rlbl '(" " "1.5D" "3D" "4D" "5D"))
(setq mlbl '(" ""1""2""3""4""5""6""7""8""9""10""11""12"))
(setq pipesizes '(0.0 114.30 168.28 219.08 273.05 323.85
355.60 406.40 457.20 508.00 558.80 609.60))
(setq radiuses '(0.0 1.5 3.0 4.0 5.0))
(defun pick_opt2 ()
(mode_tile "reb" (- 1 (atoi $value)))
(mode_tile "rlb" (- 1 (- 1 (atoi $value))))
);
(defun pick_opt3 ()
(mode_tile "meb" (- 1 (atoi $value)))
(mode_tile "mlb" (- 1 (- 1 (atoi $value))))
);
;----
(action_tile
"cancel"
;if cancel button pressed
"(done_dialog) (setq userclick nil)"
;close dialog, set flag
);action_tile
(action_tile
"accept"
;if O.K. pressed
(strcat
;string 'em together
"(progn(setq dlbp (atoi(get_tile \"dlb\")))"
;position of list selection
"(setq rlbp (atoi(get_tile \"rlb\")))"
"(setq mlbp (atoi(get_tile \"mlb\")))"
"(setq debp (atof(get_tile \"deb\")))"
"(setq rebp (atof(get_tile \"reb\")))"
"(setq mebp (atoi(get_tile \"meb\")))"
"(done_dialog)(setq userclick T))"
;close dialog, set flag
);strcat
);action tile
(start_dialog)
(unload_dialog dcl_id)
;;-----------
(progn ;1
(if userclick
;check O.K. was selected
(progn
(repeat mitrenum
(setq pt1(polar pnt1 an1 (/ rad2 (cos hsegment)))
;outer point
pt2(polar pnt1 an1 (/ rad1 (cos hsegment)))
;inner point
pt3(polar pnt1 an1 (/ rad2 (cos hsegment)))
;outer point
ptl(append ptl (list pt1 pt2 pt3))
;add to point list
);setq
(if (/= mitrenum count) (setq an1(+ an1 segment)count
(1+ count)))
);repeat
;if there is another segment increase angle by
;segment angle and count
(repeat mitrenum
(setq pt4(polar pnt1 an1 (/ rad1 (cos hsegment)))
;return segment point
ptl(append ptl(list pt4))
;add to point list
an1(- an1 segment)
;decrease angle by segment angle & go back
);setq
);repeat
(setq ptl(append ptl(list p1)))
;finished at first point and point list
(setvar "osmode" 0)
(command "._pline" (foreach ptt ptl(command ptt)) )
;draw mitre bend
(setvar "osmode" smode)
);progn
);if userclick
);progn1
)if
;;------------
(princ)
);defun
(princ)
Henry......
=================
=================
What do you call female Viagra?..... Jewelry
=================
dblArea = objArc.Area
MsgBox "Area = " & dblArea
End Sub
'CODING ENDS HERE
==================
(eval message)
(eval drawline)
Me thinks that there is more to (setq) than meets the jaundiced eye!!
Comments??
===========
http://www.afralisp.com/cartoon-a-day.htm
Around about 1982 I was asked by one of my regular clients, Kevin Eaton,
if I had seen drawings being produced on computer. I think I burst out
laughing at the suggestion, but agreed to go to a demonstration on a SKOK
system. The demo of drawing a gearwheel, complete with teeth and spokes in
just a few minutes so impressed me that I started shopping around and looked
at another system, Calcomp, costing a whopping R500 000 [~US$70 000]. By this
time I was completely sold on CAD. All I had to do now was to find a CAD system
The colour and resolution of the NCR DM5 looked the best to me and I bought
it, never for one minute doubting that I would find a CAD system to run on it.
The operating system was called CPM-80, I think.
Shortly after that, in June 1986, I took my first trip overseas to the UK for
a month, with my friend Hilary. What an experience! Whilst traveling around
the UK I visited every bookshop we came across, and any other shop that looked
as though it may sell computers, but they were far and few between. I ended up
buying a computer magazine in which there was a full page advert for AutoCAD.
After making enquiries I was directed to the distributor of AutoCAD in the UK.
Hogarth is taking Harry Potter to London to do shopping for his kit before he is
sent off to Hogwarts, a boarding school for witches & wizards. Whilst walking
through London they reach their destination, a door, which is the entrance to
the place where they need to purchase the kit. The only problem is that it
appears to Harry that he and Hogarth are the only ones who are able to see
the door, which is the entrance to the shops.
Back to my story.
After speaking to the distributor of AutoCAD, I was instructed to visit Stage
One, which is what the distributor was called.
Hilary and I set off by Underground to Waterloo Station, and map in hand,
headed for the address give us, of Stage One.
Now, for such a full-page advert of a software package that every designer
would "kill" for, I thought we should see the shop, with neon lights blazing,
from at least a block or possible even two blocks away. When we reached the
address I looked at the map, re-looked at the address, twice, then went to
After a brief discussion with Richard and one of his colleagues, we left
with "Demo Copy" of AutoCAD 1.3 under arm, very happy to now return to
South Africa and get stuck into the CAD drawing business. I had a lot
more long distance chats to Richard Handyside, most went something like
"how do you draw a line an exact length and an exact angle?" and "How do
you snap to a line". "Snap! What's that?"
However, it was not long after this that my business changed from doing
drawings, to selling AutoCAD. (Sorry Kenny) My first customer was a
Mr. Gerald Gordon who was a lecturer in Architecture at the University
of Witwatersrand, and who was referred to me by Richard Handyside.
A few years later my company Infosoft merged with two other dealers,
CadArt and TechnoCAD, to form Afracad, the largest Autodesk dealer
in Africa at that stage. Does Afracad ring a bell? (think Afralisp?)
Terry Baker
=====================
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Shake off those blues!!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-17
=========================
Tuesday 2rd September 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
For Sale!!
One leopard.
Absolutely spotless!!
=========================
Pearls of Wisdom
===============
Local Area Network in Australia :
The LAN down under.
===============
Coding
=======
;if it is
(if (= yesxref :vlax-true)
);progn
);if
);vlax-for
);defun
(princ)
;CODING ENDS HERE
=================
Hello Kenny,
Jeff
=====
;;;GAME.LSP
;;;by Esko Suomalainen, FINLAND
;;;
;;;-----------------------------------------------------------
;;;DESCRIPTION
;;;
;;;This is a game for AutoCAD.
;;;
http://www.afralisp.com/newsletter/2003/2003-17.htm (5 of 14) [23/03/2005 05:49:23 p.m.]
AfraLisp Newsletter No 2003-17
;;;Designed and implemented by Esko Suomalainen.
;;;
;;;Usage: Try to hit the target circle with the cursor!
;;;Program then calculates shots and time that had been consumed.
;;;Program is loaded and called by typing "GAME"
;;;
;;;-------------------------------------------------------------
;;;
;;;Moving the target, target is a circle
newpt
;new target location is returned to calling function
)
;;;
;;; Random number calculation
;;; Returned number is between 1 - 99
rndnum
; random number is returned to calling function
)
;;;
;;;Checking of hits
;;;
;;;
;;;"Explosion" of the target
;;;
(defun EXPL(pt)
(grdraw (polar pt 0.7 0.3) (polar pt 3.8 0.5) 1)
http://www.afralisp.com/newsletter/2003/2003-17.htm (9 of 14) [23/03/2005 05:49:23 p.m.]
AfraLisp Newsletter No 2003-17
(grdraw (polar pt 1.7 0.7) (polar pt 4.8 0.5) 1)
(grdraw (polar pt 0.2 0.2) (polar pt 3.3 0.8) 1)
(grdraw (polar pt 2.0 0.6) (polar pt 5.2 0.4) 1)
)
Command: -linetype
Mmmm, interesting!!!!
======================
1. Your house plants are alive, and you can't smoke any of them.
7. Your friends marry & divorce instead of hook up & break up.
10. You're the one calling the police because those damn kids
next door won't turn down the stereo.
11. Older relatives feel comfortable telling sex jokes around you.
12. You don't know what time the pubs close anymore.
13. Your car insurance goes down and your payments go up.
17. Dinner and a movie is the whole date instead of the beginning
of one.
19. You go to the drug store for ibuprofen and antacid, not condoms
and pregnancy tests.
22. "I just can't drink the way I used to," replaces,
"I'm never going to drink that much again."
23. 90% of the time you spend in front of a computer is for real work.
24. You no longer drink at home to save money before going to a bar.
http://www.afralisp.com/newsletter/2003/2003-17.htm (12 of 14) [23/03/2005 05:49:23 p.m.]
AfraLisp Newsletter No 2003-17
25. You read this entire list looking desperately for one sign
that doesn't apply to you.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
Shake off those blues!!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-18
=========================
Tuesday 9th September 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
For Sale!!
One budgie going cheep.
=========================
Pearls of Wisdom
===============
Sarchasm: The gulf between the author of sarcastic wit
and the person who doesn't get it.
===============
Coding
=======
Hi Kenny
;Zoom All
;--------
(defun c:za ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "_ALL")
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
;Zoom Dynamic
;------------
(defun c:zd ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "_DYNAMIC")
(while (> (getvar "CMDACTIVE") 0)
(command pause)
)
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
;Zoom Extents
;------------
(defun c:ze ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "_EXTENTS")
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
;Zoom Previous
;-------------
(defun c:zp ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "_PREVIOUS")
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
;Zoom Window
;-----------
(defun c:zw ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "_WINDOW")
(while (> (getvar "CMDACTIVE") 0)
(command pause)
)
(setvar "CMDECHO" Save_CmdEcho)
(princ)
;Zoom In 2.0x
;--------------
(defun c:z2 ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 1)
(command "._ZOOM" "2.0x")
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
;Zero Fillet
;-----------
(defun c:F0 ( / Save_FilletRad Save_TrimMode)
(setq Save_FilletRad (getvar "FILLETRAD"))
(setq Save_TrimMode (getvar "TRIMMODE"))
(setvar "FILLETRAD" 0)
(setvar "TRIMMODE" 1)
(setvar "CMDECHO" 1)
(command "._FILLET")
(while (> (getvar "CMDACTIVE") 0)
(command pause)
)
(setvar "FILLETRAD" Save_FilletRad)
(setvar "TRIMMODE" Save_TrimMode)
(princ)
)
Cheers, Mike
===========
...Bill
=====
'Ignore Numbers
'Use This in the keypress event of the Box
'Force to caps
'Use This in the keypress event of the Box
'Force to caps
'This is the function
Public Function AutoCap(Tbox As TextBox, _
KeyAscii As MSForms.ReturnInteger) As Integer
AutoCap = KeyAscii
If KeyAscii > 95 And KeyAscii < 123 Then
AutoCap = AutoCap - 32
End If
End Function
=============
To open a drawing :
Will
============
Toni
=====
Kenny my man,
A couple of shorties :
FIXX
An Improved version to (FIX)
rounds numbers to either upper or lower value.
(AutoLISP native function FIX always rounds
numbers to the nearest lower integer).
Examples :
================
SET_SLIDE
Easily activate a slide_image in a DCL
Elements :
key - STR - slide_image key name
path - STR - Full path of SLD file
color - INT - Background color
(Refer to AutoCAD DCL programming books for the right color )
(slide_image 0 0 x y path)
(end_image)
(setq fillx (dimx_tile key))
(setq filly (dimy_tile key))
)
;CODING ENDS HERE
Dave R.
=======
Kenny
D:\PROJECTS\1234\CAD\ELEC\A1SHEET.dwg
.\A1SHEET.dwg
Craig Green
===========
"I need a leader arrow that can read the ID of the point
the arrow begins and completes the coordinates in the text
string."
...........
Kenny,
pause
pause
""
Line1
(strcat "TOW EL=" Ypoint)
""
)
)
(defun c:TOLC (/ Inspt NextPoint EndPoint Xpoint Ypoint)
(setq Inspt (getpoint "Select start point: "))
(setq Xpoint (car Inspt))
(setq Ypoint (rtos(cadr Inspt)))
(if (>= Xpoint 100.0)
(progn
(setq a (fix(/ Xpoint 100)))
(setq Xpoint (rtos(- Xpoint (* a 100))))
(setq Line1 (strcat "STA " (rtos a 5) "+" Xpoint))
)
(setq Line1 (strcat "STA 0+" (rtos Xpoint)))
)
(command "leader"
Inspt
pause
pause
""
Line1
(strcat "TOLC EL=" Ypoint)
""
)
)
(princ)
;CODING ENDS HERE
Jeff Fry.
========
Hi Kenny.
I've been searching the net for a 'dwg reference scanning wizard.
I have 15,000 documents (sorted by project folders).
There is a need to scan the 15,000 files (most in DWG 2000 format.)
And record which DWG file[s] is referenced to which DWG[s].
A. Monforte
============
Gerry
======
Hi Kenny,
My other question.
Thanks,
Kris de Jong
=============
8. Then save.
6. Nobody cares if you can't dance well. Just get up and dance.
9. You will never find anybody who can give you a clear and
compelling reason why we observe daylight savings time.
10. You should never say anything to a woman that even remotely
suggests that you think she's pregnant unless you can see an
actual baby emerging from her at that moment.
11. There comes a time when you should stop expecting other
people to make big deal about your birthday. That time is
about age eleven.
12. The one thing that unites all human beings, regardless of
age, gender, religion, economic status or ethnic background,
is that, deep down inside, we ALL believe that we are above
average drivers.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
We Love Rock n' Roll......
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-19
=========================
Monday 15th September 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Anyone interested in a bargain?
I have a parachute, never opened, used once, small stain.
Offers?
=========================
Bit early, but I've got a heavy week with the band.........
Lot's and lot's of "shorties" this week. In fact, I've got enough to even
carry some over until next week. Please keep them coming though,
'cos eventually I'll be creating a "Shorties" section on AfraLisp and
I'm sure you would all like to be included.
Pearls of Wisdom
===============
"The floggings will continue until morale improves."
===============
Coding
Hey Kenny, I got busy with stuff going on at work but here are a couple
of short lisp routines.
To save:
(DEFUN C:S1 ()
(COMMAND "-VIEW" "S" "1")
(PRINC)
)
To recall:
(DEFUN C:1 ()
(COMMAND "-VIEW" "R" "1")
(PRINC)
)
This routine turns on, thaws and sets the 0 layer current:
(defun c:0 ()
(command "-layer" "t" "0" "on" "0" "s" "0" "")
(command "color" "bylayer")
(command "linetype" "s" "bylayer" "")
(princ)
)
A tilemode toggle to switch back and forth from paper and model spaces:
(defun c:ti ()
(setq a (getvar "tilemode"))
(if (= a 0) (setvar "tilemode" 1) (setvar "tilemode" 0))
(princ "\nCreated by: Andrew W. Scanlon CD")
(princ)
)
Lastly, since I deal a lot with areas I have a few routines that create
text labels noting the acreage and square feet.
Acreage:
(defun c:adt ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "cmdecho" 0)
(princ "\nCreated by: Andrew W. Scanlon CD")
(princ "\nSelect object: ")
(command "area" "o" pause)
(setq area (getvar "area"))
(setq result (/ area 43560))
(setq tx (rtos result 2 2))
(setvar "cmdecho" 1)
(command "text" pause pause pause (strcat tx " AC"))
(setvar "CMDECHO" Save_CmdEcho)
(princ)
)
Square feet:
(defun c:sfdt ()
(setq Save_CmdEcho (getvar "CMDECHO"))
(setvar "cmdecho" 0)
(princ "\nCreated by: Andrew W. Scanlon CD")
(princ "\nSelect object: ")
(command "area" "o" pause)
(setq area (getvar "area"))
Hope these are helpful. Good work on the newsletter and keep them
coming. Good luck on your next album.
Thank you,
Andrew Scanlon
==============
Kenny,
I looked thru my VB code for "short code" that I could pass on. None of it
is generic enough, and would not make sense unless you worked here. Here is
some of my lisp code. Most of the really short code that I have has already
been covered by others. This is some of the other (fairly short) code that I
have found useful.
Robert
=======
Swaps the position of two pieces of text;
;code starts here:
(defun c:swT ()
(setvar "cmdecho" 0)
(prompt "\pick first text line: ")
(setq ss1 (entget (car (entsel))))
(prompt "\npick second text line ")
(setq ss2 (entget (car (entsel))))
(setq old1 (assoc 1 ss1))
(setq old2 (assoc 1 ss2))
(setq new1 (assoc 1 ss2))
(setq new2 (assoc 1 ss1))
(setq ent1 (subst new1 old1 ss1))
(setq ent2 (subst new2 old2 ss2))
(entmod ent1)
(entmod ent2)
(princ)
)
;code ends here
This one increments numbers (numbers text). If you don't want a prefix or
suffix just hit space bar when prompted.
;code starts here:
(DEFUN C:CHNUM ()
)
(PRINC)
Kenny,
Later, 7
=========
;;; Slected-p
;;;------------------
;;; This function will test to see if something is selected on screen
;;;
;;; Returns: T or nil
;;;
;;; Author: John Kaul
;;;
;;; Usage: (if (not (Slected-p))
;;; (vlax-ename->vla-object (car (entsel))))
;;;===================================
(defun Slected-p ()
(and (cadr (ssgetfirst)))
)
======
(defun vl-UndoEnd ()
(vla-EndUndoMark
(vla-Get-ActiveDocument
(vlax-Get-Acad-Object)
)
)
)
===========
;;; VLASEL
;;; This function mimics the AutoLISP entsel function.
;;; The difference is that the return value is a vla-object.
;;;
;;; Returned Value: A the selected item as a vla-object
;;; such as: #<VLA-OBJECT IAcadCircle 01b42790>
;;;
;;; Usage: (setq MyJunk (vlasel))
;;;================================
;;;=============
;;; VLA-ENTLAST
;;;-------------
;;; This function mimics the AutoLISP entlast function
;;; -The difference is that the return value is a vla-object
;;;
;;; Return Value: The item as a vla-object such as:
;;; #<VLA-OBJECT IAcadCircle 01b42790>
;;;
;;; Usage: (setq MyJunk (vla-entlast))
;;;====================================
***POP11
[Info]
[$(eval,Drawing: $(getvar,dwgname))]$M=$(getvar,dwgname);
[$(eval,Date: $(edtime,$(getvar,date),MON DD""",""" YYYY))]+
$M=$(edtime,$(getvar,date),MON DD""",""" YYYY);
[$(eval,Day: $(edtime,$(getvar,date),DDD))]$M=$(edtime,$(getvar,date),DDD);
[$(eval,Time: $(edtime,$(getvar,date),H:MMam/pm))]+
$M=$(edtime,$(getvar,date),H:MMam/pm);
[$(eval,Elapsed: $(edtime,$(getvar,tdusrtimer),H:MM:SS))]+
$M=$(edtime,$(getvar,tdusrtimer),H:MM:SS);
[$(eval,Scale: 1:$(rtos,$(getvar,dimscale),2,2))]+
(strcat "1:" (rtos (getvar "DIMSCALE") 2 2));
Jorge
=============
(vl-load-com)
(vla-eval applic (strcat "MsgBox \"Or, are you not Well?\"" ", "_
"vbCritical" ", " "\"VBA Expresso\""))
(princ)
);defun
(princ)
;CODING ENDS HERE
==========
(vl-load-com)
(princ theurl)
);defun
(princ)
;CODING ENDS HERE
========
Kenny:
Ron Albrecht
============
Kenny,
Thanks,
Andrew C. Millard
================
;----start coding---
(defun c:lfix ()
(setq ldr (car (entsel))
ldd (entget ldr))
(progn
(setq odr (assoc 72 ldd)
ndr (cons 72 1)
ldd (subst ndr odr ldd))
)
(entmod ldd)
(princ)
)
;-----end-----
Hi Kenny
<snip>
Have you seen yet any way to manipulate the "QLEADER"
<snip>
Below comes courtesy of Robert Bell via the LISP Guild on the AUGI Web Site -
;|
qlset.lsp - example initialization of QLEADER settings
Frank Whaley, Autodesk
(acet-ql-get)
Returns an association list containing the current QLEADER settings from the
Named Object Dictionary.
(acet-ql-get <alist>)
Sets the specified values for QLEADER settings from the given association
list.
Returns an association list containing the new values.
Both functions use the following group codes to identify QLEADER settings:
|;
;; put back
(dictremove (namedobjdict) "AcadDim")
(setq cur (append '((0 . "XRECORD")(100 . "AcDbXrecord")(90 . 990106))
cur))
(dictadd (namedobjdict) "AcadDim" (entmakex cur))
(acet-ql-get))
;; load quietly
(princ)
Cheers, Mike
============
Kenny,
He should join the opendwg alliance, then download my program "Archive Them"
from www.vbdesign.net. He will need visual basic to modify the code a bit
and add recursion. But it should give him a good start.
Jeremie Schultz
==============
http://www.cadalyst.com/solutions/alispsols/0801als/0801als.htm
Cheers, Mike
============
Michael Perry
============
H3ll0 7h3r3. 50 y0u'v3 d3c1d3d 70 p4y 4 v1517 70 5n34k P34k h4v3 y0u?
http://www.vbdesign.net/modules.php?name=Sneak_Speak
DCL Primer.
http://www.afralisp.com/zip2/dcl_primer.zip
=====
Batch Purge 2004.
http://www.afralisp.com/vba/bp2004.htm
=====
Basic Tool System Primer.
http://www.afralisp.com/lispb/toolr.htm
A man and his wife are awakened at 3 o'clock in the morning by a loud
pounding on the door.
The man gets up and goes to the door where a drunken stranger, standing
in the pouring rain, is asking for a push. "Not a chance," says the husband,
The man does as he is told, gets dressed, and goes out into the
pouring rain.
He calls out into the dark, "Hello, are you still there?"
"Yes," comes back the answer.
"Do you still need a push?" calls out the husband.
"Yes, please!" comes the reply from the dark.
"Where are you?" asks the husband.
"Over here on the swing!" replies the drunk.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
We Love Rock n' Roll......
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-20
=========================
Tuesday 23rd September 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
For Sale :
3 cows never bred.
Also 1 gay bull for sale.
=========================
Well I'm finally back home and can drink some decent beer instead
of the 'orrible South African stuff that tastes of chemicals.
By the way, the national drink of Namibia is a grape fruit schnapps
known as Pamulmoosen. Lovely stuff.
Anyway, long letter today so let's get on with it.........
Pearls of Wisdom
===============
If a man is standing in the middle of the forest speaking and there
is no woman around to hear him...is he still wrong?
===============
Titus B. Ruch
============
Hi Kenny,
We keep small hardcopies (A3 size) of sample drawings for our reference
and for the clients too.
The drawing which are older than 2 years are backed up on CD's. I have
made an Excel file with a VBA macro to add file names of the CD's and a
second macro to find files and on which CD each file is located.
greetings
Sherko
=======
Ron Albrecht
============
Kenny,
Elise Bauman
============
Hi Kenny, Whassup!
We also keep the DWG files electronically stored on our network server.
Sometimes when we need to copy some stuff from another project (you know
the deal; you catch yourself thinking "oh yeah, didn't we already do somthing
like that somewhere back in 1998 or so....")
Coding
=======
Hi Kenny,
Did someone do this already?
Mark Johnston
==============
^C^Cline;^C^C
Chau Amigo .
============
Kenny:
TXTR.lsp - Replaces the text string of one text entity with the
text string from another, and deletes the second selected entity.
TXTS.lsp - Adds the text string of one text entity to the end of a
second selected entity, adding a space before tacking on the
additional text. The second selected text entity remains untouched.
Removing the semicolon in the code in front of the ERASE
command will change the program so that the second selected
text entity is deleted.
Ron D.
======
Hoi Kenny,
Greetings,
Joop
Kenny,
I often find it handy to divide the space between to points with nodes at
equal spacings to facilitate setting out other graphics etc. This little
program does just that (default spacing is 2).
(Don't forget to set pdmode and pdsize to the required values.)
Obviously, all the nodes added by pd.lsp will not be required once setting
out has been completed. The program dp.lsp erases ALL nodes on the
drawing.
Regards,
Craig Green
===========
Mark Thomas
http://www.theswamp.org
============
Kenny
Some times I find it very handy to draw what I call 'disconnected lines'.
For example say you want to draw a line from point 1 to point 2 and then
from point 3 to point 4 WITHOUT drawing a line between point 2 and point 3
etc etc. To achieve this I have written dline.lsp.
Some times I also find it very handy to be able to select (window) several
Regards
Craig Green
===========
John Kaul
==========
Weird Things!!!
http://www.weirdies.com/weird-photographs.html
=========
Kenny,
(getvar “HideSystemPrinters”)
I was looking for this the other day and had trouble finding it.
Cheers,
Tad Wirmel
==========
Mail Tracker
http://www.theinquirer.net/email_tracker.htm
==========
Economic reality!
AN AMERICAN CORPORATION
You have two cows.
You sell one, and force the other to produce the milk of four cows.
You are surprised when the cow drops dead.
A ZIMBABWEAN CORPORATION
A farmer has two cows.
You take over his farm, eat both cows and wait
for the international community to supply more.
A JAPANESE CORPORATION
You have two cows.
You re-design them so they are one-tenth the size of an
ordinary cow and produce twenty times the milk.
You then create clever cow cartoon images called
Cowkimon and market them World-Wide.
A GERMAN CORPORATION
You have two cows.
You re-engineer them so they live for 100 years,
eat once a month, and milk themselves.
A BRITISH CORPORATION
You have two cows.
Both are mad.
AN ITALIAN CORPORATION
You have two cows, but you don't know where they are.
You break for lunch.
A RUSSIAN CORPORATION
You have two cows.
You count them and learn you have five cows.
You count them again and learn you have 42 cows.
You count them again and learn you have 12 cows.
You stop counting cows and open another bottle of vodka.
A SWISS CORPORATION
You have 5000 cows, none of which belong to you.
You charge others for storing them.
A CHINESE CORPORATION
You have two cows.
You have 300 people milking them.
You claim full employment, high bovine productivity,
and arrest the newsman who reported the numbers.
AN AUSTRALIAN CORPORATION
You have two cows.
The one on the left is kinda cute...
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If we are too loud, you are too old.
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-21
=========================
Tuesday 30th September 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Are you illiterate?
Write today for free help.
=========================
We need you to tell us what was the most amusing, interesting, mind blowing,
leg shaking, despicable thing that ever happened to you, or that you witnessed
whilst at work.
Two Rules :
Each story will be published in the Newsletter but please keep your story as
short as possible as space is at a premium.
The competition will run over two weeks with the winner being announced
in three weeks time. So, get writing and send your entry to this address :
mailto:[email protected]
and put "The Competition" in the "Subject" line.
Judges :
So if you’ve ever wanted to create multipage PDF files of your AutoCAD and Word
documents stop by and check us out. If you’re looking at integrating PDFs into your
existing workflow or document management routines just let us know, we love doing
customization and we can save you a ton of headaches.
We look forward to reading your stories and please stop by and give us your
feedback on our AcroPlot program at www.cadzation.com.
==================
By the way, I've got the licence already, just waiting to be awarded to
some lucky soul.
So come on.........we're all waiting........
==================
Pearls of Wisdom
===============
Move your vowels every day or you'll get consonated.
===============
Kenny,
I haven't had a chance to reply until now, but let me see if I can fill you
in on how things are done here. Once the project begins, our drawings are
Something new that we will be starting, is to not only archive the CAD
files, but create and archive PDF copies of each drawing. This gives us
three important advantages. One, we have a "photographic snapshot" of a
drawing at a specific time. We do not have to worry about bringing up a
drawing and worrying if the xref has been changed. Two, more and more of
our clients are requesting an electronic copy of the drawings, and this
makes a nice tidy package to give them. Three, easier printing if we need
to verify something that went out. On occasion, we need to access a
drawing which may have been submitted several months earlier. By having
PDF's, anyone with a program on their computer that can read PDF's can look
at the exact same drawing the contractor is looking at, or if need be,
print it out.
Martin Kriewall
=============
Jorge Párraga
=============
Coding
=======
Kenny,
I've been holding back for weeks but I just can't keep this bit of code
to myself anymore. I defy anyone to make real use of this routine. I've
used it all of twice in the last 5 years, but I'm glad I have it.
Cheerio compadre
Ron Albrecht
============
Hi Kenny,
greetings
Sherko
======
Opening a drawing:
(command "._vbastmt"
http://www.afralisp.com/newsletter/2003/2003-21.htm (6 of 12) [23/03/2005 05:49:31 p.m.]
AfraLisp Newsletter No 2003-21
"ThisDrawing.Application.Documents.Open(\"DrawingName.dwg\")")
New drawing:
(command "._vbastmt"
"ThisDrawing.Application.Documents.Add")
Frank
======
Some Questions
===============
Hello Kenny:
I have one question maybe you can help me out. The situation is I'm trying
to develop an aplication in AutoCAD Map, using VBA, but also I do havesome
AutoLISP routines alreday developed that I want to include within the VBA
code. Most of them (LISP) works fine in the VBA code using the
"Thisdrawing.SendComand (....)" method, but the ones which has to make an
interaction with the AutoCAD screen like mark an area (polygon) just do not
wait for the action on the screen and finalized the lisp routine, and the
VBA code continue to the next program lines until the end of VBA code, and I
get put into the AutoCAd windows to continue with the lisp code. As an
example if you include in the middle of a VBA code the "adequery" command
it will show the query define window, but when you try to define a polygon
area for the location query the next VBA code lines continues to execute not
waiting to finished the "adequery" command.
Alberto Andrade
===============
Dear Kenny
Is it true that tutorials provided for download in the site
will erase hard disk after one week?
Regards
Narendra.G
thanks,
Kevin
======
Kenny.
I would like to be able to use a dialog box to choose which LISP file to run.
How do I make a call to run another lisp file from a radio button?
thanks
jorge
=====
Interesting!!
http://bbspot.com/news/2000/4/MS_Buys_Evil.html
Thanks Andy
============
* 12 cases of beer
* 9 bottles of Whisky
* 4 x 2 litre Coke (for mix)
* 4 x 2 litre Coke Lites (for the chicks and Fat Freddy)
* 1 bottle of Sherry (for the chicks and your wife's gay cousin
Saturday:
05:00: Throw 2 bags of charcoal, January through March's Expresses and a
half a box of firelighters in the drum, and light the lot for a good
solid barbeque foundation.
05:35: Open 1 bottle of whisky and one 2 litre Coke.
06:15: Mutter to yourself that you're sure they're making the whisky bottles
smaller these days, and crack open a beer.
06:20: Go check that no one stole the meat from under your carport during
the night.
06:30: Beer
06:35: Beer
06:45: Email your mates to tell them "Today's going to be a fu$%en party!!"
06:55: Explain to your mom that you accidentally emailed her and that you
would never swear at her.
07:00: Beer
07:20: Microwave some of last night's Mac 'n Cheese for breakfast.
08:00: Wake up your wife so that she can go jogging on your behalf.
08:30: Walk around the house (and yard) naked while you're wife is out
jogging,
making sure that everything is going good. - Check on the fire.
08:45: Throw in another bag of charcoal and the rest of the first box of
firelighters.
09:15: Explain to your wife that the reason you're walking around naked
is to get rid of your snoring problem - You read this in a men's Health Magazine
10:00: Give her money to go buy buns and stuff for the barbeque.
http://www.afralisp.com/newsletter/2003/2003-21.htm (10 of 12) [23/03/2005 05:49:31 p.m.]
AfraLisp Newsletter No 2003-21
10:15: Stop arguing and give her more money to get her hair done.
10:20: Give her your credit card.
10:30: Sit down to watch some TV and have a few beers.
11:30: Wonder where the first case of beer went, take one from the second case.
12:30: Look at your 9 cases of beer and decide that it should still be enough
for the guys.
12:55: Tell your wife that you only had 1 or 2 beers and that she shouldn't
moan so much.
13:00: Fat Freddy and his wife arrive - open 2nd bottle of whisky and the
Coke Lite, and open the Sherry for his wife.
13:45: Feel a slight buzz.
14:30: Look at the 3rd bottle of whisky and squint.
14:45: Feel buzzed more.
15:00: By this time should be everyone there.
15:15: Charcoal another bag of throw on the barbeque and open a beer.
15:30: Talk sh*t and beer
15:45: Ask the chicks if the ready is buns and the buttered.
16:00: More talk sh*t.
16:30: Arm wrestling competitions with gay the cousin.
16:50: Say to everyone that you win him let.
16:55: Suck petrol out of Fat Car's Freddy to just in case..
17:15: Give the Sheep to your friend Aussie and luck them wish future for the.
17:30: Meat the rest of the barbeque on the put and beer another have.
18:00: The more needs to fire burn, get the petrol.
18:45: Closest Medical Centre - Burn grade 1st wounds.
19:30: House at back - Freddy thank for beer open another barbeque and the
6th bottle of whisky.
20:30: Open Whisky bottle of 7th and hand Whisky out shooters of.
21:00: Tell love that you everyone them, especially Fat Freddy's Wife.
21:30: Finish the last beer of Whisky and case of bottle.
22:15: Closest Cedical Mentre - Stomach Pump
Sunday:
03:45: Eat.
---------------------------------------------------------
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-22
=========================
Tuesday 7th October 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
This [send money] is a [send money]
subliminal [send money] message.
=========================
Well, believe it or not, but I've only had four entries for "The Competition!!!!"
So come on every one of you. Only one more week to go before entries close.
Here's a review of what it's all about :
"We need you to tell us what was the most amusing, interesting, mind blowing,
leg shaking, despicable thing that ever happened to you, or that you witnessed
whilst at work."
A free copy of AcroPlot Software ($149 U.S. value) to the winner, compliments
of CADzation (www.cadzation.com)
AcroPlot is one of the best ways to convert AutoCAD drawings and Word
documents to PDF files.
Just this morning , at our on work breakfast , I remember and tell my crew
about a despicable thing that ever happened to me.
Circa 1977 , on a warm province in Argentina , Catamarca , maybe about 35
to 38 °C on shadow.
We were uncrating a imported machine, whose crate was broken, and part
get rust and were stucked.
As we where on a country site, far from a wharehouse to get a LOOSIT liquid,
not know how you named it, i ask a
guy , those who ever goes to bring any thing we need .
Hi Joe , please go to the bar and get a Coke, hope you know it is a god anti rust
and looser part when they were blocked by rust.
After a wile , he went back us and say : Boss I bring a FANTA, cos' COKE is Hot.
You migth wonder what I told him.....
Hi-ya Kenny,
My story is pretty short and, to tell ya the truth, not that good but
what-da-hell.
I work in the Arch/Mech field and one day my co. gets a job for one of
the local zoo's here in town. The Zoo's seal pond needed re-piping. The
job called for a bunch piping to circle the outside of the pond. A
"senior" (Let's call him Bob) came up to me and asked me to draw
something up in CAD to work out some dimensions. I, of course, said
"Sure. What do you want me to draw?"
A couple of days later I'm just chatting with my boss and he mentioned
http://www.afralisp.com/newsletter/2003/2003-22.htm (2 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
that he wanted me to help someone with a small job.
"The job should be quite easy; 'Bob' found a new solution to a potential
problem."
"Sure. That's good, what did he do?"
"He came up with the idea of using HDPE instead of PVC on the 'Zoo
job'."
"He did?"
"Yeah, he said it just came to him."
(Yeah, "Came to him" ...I'll give him something; I'll put my boot up
his...) I asked 'Bob' about that; he said that he went with his
"original design" of using HDPE instead of PVC.
...See ya!
John
======
The most despicable thing that has happened to me at work was having
to share an office with a guy who smelled like a skunk. I was working
for an architect in Southern Oregon at the time and it was August,
the hottest month of the year. My office mate was known for getting his
drink on and he had done so this particular night, went home, bent down
to pet a cat on the porch and got sprayed right in the chest. Don't ask me
why, but he felt that he must share his stench with the office and in particular
me by coming into work the next morning. I tried my best to keep his air on
his side of the room with fans and such but it didn't work and the heat just
seemed to increase the volume. For two weeks I had to smell it all day at the
office and as soon as I would get home, I would have to shower to get the
stink off that followed me there. The problem that still gets to me is that he
didn't even own a cat!
Elise Bauman
============
Regards,
Florence
========
Pearls of Wisdom
===============
Beer: So much more than just a breakfast drink .
===============
Coding
=======
There are three major API's with which you can extend AutoCAD. They are respectively :
a C/C++ api called objectARX, a VB/VBA api, and an AutoLisp/VisualLisp api.
Every developer has their favorite but all partiality aside people often wonder
which is better, which should I use? The answer to those questions is:
"It depends on what you need to accomplish".
Each API has different things, which make it better in given situations.
When deciding on which API to use there are 4 things you need to ask yourself.
What language am I most comfortable in?
How much time do I have? Who is the target user and how much AutoCAD experience
do they have?
How much control over AutoCAD and possibly Windows do I need to accomplish the
task quickly?
After I address some of the functionality of the different API's you will see
why these are relevant.
I am only going to deal with these API's as they apply internally to AutoCAD
not as stand alone applications.
Out of the three API's this one has the most control over AutoCAD and Windows.
http://www.afralisp.com/newsletter/2003/2003-22.htm (4 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
You can register its commands with AutoCAD. The user needs to know very little
about AutoCAD to run your program. The drawbacks to it are it takes longer to
develop in it for most developers than VBA or Lisp, and often it is overkill
especially for simple drafting tools. To get anything done in this API you
should already be very familiar with C and C++. On a personal level this API
is my favorite but that is because I do 99% of all my development in C and C++
so when I do something for AutoCAD it's easier for me not to have to switch
languages. For me it falls into the category of "what language am I most
comfortable with?". There are things within AutoCAD that this API can access
that the other API's cannot. This is the major reason for most developers who
use this API. They need to do something and it literally cannot be done using
the other two API's. This is also the only API to which you can secure
your code from having others read and copy your source. If you need to
develop custom objects, work with spatial filtering, expose functionality to
an application using another API, are developing third party tools for sale,
or a host of other things to which VBA and Lisp cannot access without great
difficulty or at all then this is the API you should use.
If this is your first time extending the functionality of AutoCAD than this
is most likely the API for you.
This API is very friendly towards new developers.
The Visual Basic language reads in such a way that many times new developers
can work out simple questions by just reading the names of the functions.
This API does not have as much access to AutoCAD as the C++ or Lisp API's
do however you can construct and execute Lisp commands to give yourself
access to the few things that Lisp can do which VBA cannot natively.
If you are very good with VBA you can subclass the AutoCAD command line
and then there really isn't anything Lisp has access to which you wouldn't
using VBA. The major drawback to the VBA API is that it doesn't natively
register your functionality with AutoCAD. It must first be loaded as a dvb
in any of the various ways you can load applications into AutoCAD and then
executed via the tools menu or by a custom button or menu item. Depending
on your user base this can be a big issue. I have worked on contracts where
the drafters are all used to commands and don't want to use anything else.
In this case VBA can be a difficult sell. If the user group isn't that stuck
in there ways then VBA is usually a very easy sell. Especially after they
see how fast you can create tools with it. As with Lisp this is primarily
an internal developer's tool to extend AutoCAD within your company, or if
you have been contracted to work on site to write custom tools. Out of all
the API's this is the one, which can create applications the most quickly
especially applications, which require graphic dialogs.
http://www.afralisp.com/newsletter/2003/2003-22.htm (5 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
It also has the most support from AutoDesk.
Here is a simple checklist for determining which API may be right for your project:
ObjectARX:
·You are most comfortable working in C or C++
·You need the absolute maximum amount of control over AutoCAD and Windows
·You need to write custom objects
·You need access to things which are not exposed to VBA or Lisp
·You require more speed than can be had using VBA or Lisp
·Your workplace requires applications be developed in C or C++
·You need to use libraries external to AutoCAD which are only available to
C or C++
VBA:
·You are most comfortable working in VBA
·You need to use a dialogs
·You need to interface with Windows or one of the Microsoft office programs
http://www.afralisp.com/newsletter/2003/2003-22.htm (6 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
like Excel
·You are new to developing for AutoCAD or are new to developing period
·You require maximum speed of development time yet are not overly worried
about application speed
·You know you are going to need a lot of help from Autodesk getting your
application written
Lisp:
·The world ended and there are no other tools available
·You are most comfortable working in Lisp
·You are working with an AutoCAD version prior to 2000
·You are working in one of those gray areas in AutoCAD where Lisp can
do something that would
require a huge amount of VB knowledge to accomplish the same thing.
·Your workplace requires it
·Your workplace may need to interface existing Lisp libraries with your tool
·You enjoy pain
·You don't need any dialogs or graphical user interaction other than the
command line/screen pics in your application
·Parens make you happy (oh look here come the men in white coats for you now)
Now I will provide what you all come here for really. Free code.
Yes, that's right we know that's
why you really read this stuff isn't it. So since you suffered through the
above I suppose I shall have to reward you with free code so that you come back.
In each of the three API's I show a way to edit the first editable attribute
in a block reference. The use of "command" will not be seen here as that is
a huge pet peeve of mine. If you are using "command" you are not programming
you are scripting and they are two completely separate things.
ObjectARX:
void chngAtt()
{
ads_name entres;
ads_point ptres;
AcDbObjectId _Id, _attId;
AcDbObjectIterator *pIttr = NULL;
if(acedEntSel("Select a Block Reference", entres, ptres) != RTNORM )
{
//Selection failed
return;
}
http://www.afralisp.com/newsletter/2003/2003-22.htm (7 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
acdbGetObjectId(_Id, entres);
AcDbObjectPointer<AcDbBlockReference> pRef(_Id,AcDb::kForRead);
if(pRef.openStatus()!=Acad::eOk)
{
//Open failed
return;
}
pIttr = pRef->attributeIterator();
while(!pIttr->done())
{
_attId = pIttr->objectId();
AcDbObjectPointer<AcDbAttribute> pAtt(_attId,AcDb::kForWrite);
if(pAtt.openStatus()==Acad::eOk)
{
pAtt->setTextString("We changed this");
break;
}
pIttr->step();
}
delete pIttr;
}
VBA:
Option Explicit
Sub chngAtt()
Dim objEnt As AcadObject
Dim objRef As AcadBlockReference
Dim varAtts As Variant
Dim objAtt As AcadAttributeReference
Dim emptyPt As Variant
Lisp:
(defun C:chngAtt ()
(setq Mainent (entsel))
(setq entList (entget (car Mainent)))
(setq entAtt (entget (entnext (cdr (assoc -1 entList)))))
(setq entNewAttVal
(subst (cons 1 "We changed this") (assoc 1 entAtt) entAtt)
)
(entmod entNewAttVal)
(entupd (car Mainent))
(princ)
)
================
I had the same need to be able to run lisp routines directly from a dialog box
and came up with the following solution. I whittled it down to just three routines
for this sample but usually it contains 15 choices. I included routines that aren't
used often or are forgotten so that people in the office only have to remember
one command and then they can choose the routine they want to run, hit OK,
and then the chosen routine begins.
(defun c:lisp ()
(start_dialog)
(unload_dialog dcl_id)
(if (= lld "flow")
(progn
http://www.afralisp.com/newsletter/2003/2003-22.htm (9 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
(load "flow")
(c:flow)
)
)
(if (= lld "pcut")
(progn
(load "pipecut")
(c:pcut)
)
)
(if (= lld "ply")
(progn
(load "ply")
(c:ply)
)
)
)
lisps3: dialog {
label = "Load Lisps";
:column {
:radio_button {
key = "flow";
label = "&Flow - Places a flow arrow (FLOW)";
}
:radio_button {
key = "pcut";
label = "&Pipe Cut - Draws end of a cut pipe (PCUT)";
}
:radio_button {
key = "ply";
label = "Pl&ywood - Creates a plywood section (PLY)";
}
}
spacer;
ok_cancel;
}
Elise Bauman
============
Questions
========
Hi Kenny
Rob Hemelop
============
Rob,
David Stein has a whole chapter dedicated to objectDBX in his "Visual Lisp Bible."
You can find it here :
http://www.dsxcad.com
You can also try the "OpenDWG Type Library" section which you can
find here :
http://www.vbdesign.net/expresso/
====================
Do you know how to disable the macro alert dialog through the registery?
thanks
Christian
========
I have a LISP that opens a dialog box, & fills info into attributed blocks.
Part of the LISP allows you to do several blocks in a row, and jump around
in the order that you do them. I want to add an UNDO mark to the LISP, but
as the Dialog is up always, I can't do the old standby of (command "Undo"
"mark") as it crashes every time it comes to this spot. Is there a way to
add an Undo mark without using the command function?
Jonathan Trostad
==============
I would like to add data to the 'drawing properties' window - 'custom' tab.
I found the info in the dxf codes, but I can not figure out how to insert
information into the fields by coding it.
James Herriott
=============
i have this...
$(substr,$(getvar,dwgname),7,2
is ther a list or a site who i can see all available function for rtext ??
thanks.
Andrea Andreetti
==============
Hello mr.Kenny
Karl Browning
============
Taking her by the shoulders, John proceeded to scold her for her
lack of discretion and good judgment.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
http://www.afralisp.com/newsletter/2003/2003-22.htm (14 of 15) [23/03/2005 05:49:33 p.m.]
AfraLisp Newsletter No 2003-22
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
The More you Drink, the Better We Sound!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-23
=========================
Tuesday 14th October 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
Forecast for tonight: Dark
=========================
Well that's it!!! The Competition is now closed. This weeks entries are listed
below and the winner will be announced next week.
Thanks to all who took the time and effort to participate.
An apology is due to Andrew Canfield for spelling his name wrong last week.
Sorry Andpy!!
You might have noticed that I've had a few guest writers over the past couple
of weeks. Well I'd like to extend an open invitation to all readers of this Newsletter
to please feel free to send me any contributions that you would like published.
It does not have to be coding specific but a CAD flavour would be nice.
http://www.afralisp.com/newsletter/2003/2003-23.htm (1 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
Pearls of Wisdom
===============
100% of all smokers die.
So do 100% of all non-smokers.
===============
The Competition
==============
My funniest things that happened at work is when we moved into our new
building 3 years ago in the middle of winter .....
Check out the list below, as we had fun with telling it like it
is when moving into a building that isn't finished.
Monique
1. Don't know what floor you are on in the stairwell (no signs).
2. All the subtrades are "playing" with the HVAC systems and
everyone thinks the design is poor.
3. You have to use a plunger to open the kitchen cupboards
because there is no handles.
4. Contractors (males) are going out on dates with employees (females).
5. Men socialize with women in the washroom because there are no signs.
6. You can't access archived drawings because they're still buried deep in
moving boxes that can't be unpacked until the millwork is complete.
7. Dressing casual is a necessity (or better yet - you're made to do your desk
job wearing steel-toed boots, hard hat and safety glasses).
8. People you speak with on the phone, think that you're on your cell phone
at a construction site.
9. Your vehicle experiences multiple flat tires in your parking lot due to
construction debris.
10. There are bright pink streamers hanging from your ductwork in the
ceiling space.
11. Your deficiency list is 10 pages long and growing.
12. "As-Built" drawings are a work-in-progress.
13. There are no lights in your office.
14. You're in great shape because you've been forced to use the stairs
http://www.afralisp.com/newsletter/2003/2003-23.htm (2 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
until the elevator is operational.
15. You're on a first name basis with all the contractors.
16. You actually need signs to direct visitors to the reception desk.
17. You are forced to dry your hands with toilet paper.
18. You have no heat in your office but there's plenty of hot water running
in the urinals and toilets.
19. Opening the middle kitchen drawer is quite the challenge when you
have to start by opening an end to open the one beside it, because there is
no handles to pull on.
20. It's the weekend and you get stuck in the partially finished elevator,
and can't remember anyone's phone number.
============
Hi Dear.
I guess I'll give it a try. A couple years ago before I left Hungary I used to be a
site supervisor and our workers were mainly Hungarian with the required trade
schools or licenses. So you could say that you were safe. Then I left for a couple
of years and I recently returned from Canada, where I used to design curtain
walls and other structures, can say in a safe environment. I started a renovation
on 5 stories 45 years old steel-structured building as a site supervisor- again. I
represented the principal contractor and had to handle the sub contractors.
What I found was really scary: namely the majority of the workers are now illegally
employed Romanian helpers sold out as trade persons who could not speak Hungarian
or other languages. They had no clue about construction work, demolition, remove
electrical cables, shut down water systems and so on. My nightmare had just begun.
You can imagine how tough the renovation could be on site, this was even worst.
Simple request like "please remove that wire there, then connect it with this and
then make light here to see here turned out to be shocking in body parts, sparking
in eyes, burning around ears. All this happened on a so call Romanian electrician.
Then the other day asking him and showing actually pointing to the next place
where the job was supposed to be started he went to the opposite direction with a
shovel to find job for himself. At this point I needed to fire him. Keep on with my
story for the price, we just finished the reinforcing procedures of the existing I column
on scaffoldings when I left the staff behind and were heading for the project inspector
who was a tough and strict guy but new on the site. He was front of me about five
meters far and between us was built the three stories of scaffolding. I was smiling,
shaking my hands welcoming him given the impression that as if I really needed him.
Then all of a sudden the two legs - the right and the left - of the scaffolding started t
take over the steering and slowly but firmly right before the inspector collapsed
making me ridiculous. We both were frozen to death. Then I awarded myself with
strength to fire myself to save my own ass from temporarily immigrants though
permanently idiots.
Years ago we relocated our office from one of the oldest buildings in town to a
brand new multi story building with all the modern safety/security features.
Amongst our band of highly professional architects was a rather eccentric man;
we’ll call him Rob, who decided to work back one night to catch up on his work
due to the time lost during the move. Rob got a bit carried away and before he
knew it, he was the only one left in the office and thought it was about time he
called it a night. After packing up, he hopped into an elevator (lift) and pressed
the ground floor button.
When he reached the ground floor, he discovered, to his horror, that the front
doors of the building were electrically locked - he was trapped! Being the quick
thinker he was, he returned to his lift and pressed the button to his floor to call
for help. Unfortunately, the new access control system rendered the lift useless
after hours unless a floor specific swipe card was used. Of course, Rob hadn’t
been issued one as yet. He was stuck again. Aah, but wait, the modern lift car
was fitted with an emergency telephone! Rob picked up the receiver and was
automatically connected to an operator at the monitoring service. Rob explained
his predicament, but for some reason, the operator wanted to know the number
of the lift car he was in. Although the number was displayed on an illuminated
pushbutton inside the lift, Rob ventured outside the lift, holding onto the telephone
to see if there was a number on the lift architrave. The lift doors promptly closed
and the lift car returned to its home position at the top floor. Rob was left holding
a telephone with a rather short cord, and it appeared he had been disconnected!!!
It was around about this time, as I recall, that Rob spotted the EXIT signs (probably
illuminated by his RED face) that led him directly to the after hours exit door!
Craig Green
===========
We had a chap, now retired, who had the unbeknownst nickname of "Top of the
line Ed". Everything he bought was, as he went on about it, first rate, the
best.
During an afternoon coffee break, one threatening cloudy day, one of the
guys, Bob, had enough of this first rate bragging. (I'm sure everyone can
empathize, sympathize or even begrudgingly relate to this situation for
there's an Ed in every group).
Bob decided not to take a coffee break that afternoon. When everyone left
the office he took the lampshades from the boxes and hid them out of sight.
When the crew returned Bob joined them on the way back from the washroom.
Bringing attention to the boxes, he sarcastically commented that the
cartons shouldn't be blocking the isle.
Bob proceeded to furiously jump up and down on the boxes, squashing them
pancake flat. Ed looked on with wide eyed chin dropping amazement. When Ed
got excited, his voice increased in pitch, by several octaves.
Needless to say, Ed still bragged but kept nothing personal in the office
for the next 15 years.
Kevin
=====
Daryl, being a new draughtsman in a piping design office was asked to help
measure up some piping for an offshore platform. It was explained to Daryl
that the job was for a couple of days, and it would be a good idea to take a
tennis racket, as after the helicopter has taken off, the lads put up the nets
on the helideck ready for a game or two of tennis after work ....
Needless to say, we heard reports back the next day of Daryl boarding the
helicopter with his tennis racket!
Regards S.Rowe
==============
Dear Kennie,
This concludes my story of the most dispecable thing that ever happend to
me.
Joop Moelee
============
#1
A fellow co-worker, let’s just call him Robert, recently bought a new music CD.
Robert is in his early 50s. He had been listening to it non-stop for most of the
day via headphones. Finally at about 4:00 pm he couldn’t contain himself anymore.
He unplugged the headphones letting the music play through the PC’s speaker.
Next he climbed on top of his desk and proceeded to dance to his new CD.
Those that didn’t look at him like he was crazy, were on the floor in tears from
laughter at the sight of a 50 year old man with gray hair dancing on his desk.
#2
Robert also was a bit gullible. A couple of years ago a joke email was circulating
around the office. It was simply a WAV file that shouted “HEY EVERYBODY I’M
WATCHING PORNO.” The body of the email said to turn your volume up before
listening. Well Robert received this email prior to having his headphones plugged
in. Being a bit gullible, he did as instructed and cranked the volume in a library
quiet office. As the file started playing Robert, realizing that it was way too loud,
lunged for his PC which was on top of a drafting table set nearly 3 feet off the ground.
Rather than turning down the volume he hugged his computer attempting to muffle
the sound. Robert also turned candy apple red. Well as if the first time wasn’t enough,
one of the CAD guys emailed him the exact same email a few days later. Once again
he cranked up the volume and played it. A few weeks later he received the same file
with a different name. He fell for it again.
#3
A coworker of mine (Bill) asked for my help creating a VBA program. This program
was to draw either a line or an arc between two circles that had known constant radii,
with the line/arc trimmed out of the circle. A selected block was to be inserted at the
midpoint of the line/arc. So I put together the program for Bill and he was happy. A
http://www.afralisp.com/newsletter/2003/2003-23.htm (7 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
month or two later Bill comes up to me and starts chewing me out. “Why don’t the
lines/arcs go to the points I picked?” After a few minutes trying to determine what he
was asking I realized what he was upset about. Then I simply told him, “Because that
is what you wanted.” Then I explained to him the purpose of the program and that the
line/arc trims itself outside of the circle like you wanted it too.
Andrew Scanlon
===============
Coding
=======
Kenny,
I do, I enjoy the pain of having to type 1/6 the code of a C program and 1/2
the code of a VBA program. I enjoy not having to make a bazillion declarations
before getting to write the code that is actually doing the work I need done.
I enjoy not having to remember double or quadruple the amount of syntax
rules to write the code.
3. You don't need any dialogs or graphical user interaction other than the
command line/screen pics in your application.
Not true anymore. You can buy ObjectDCL and have a larger control selection
than one does through VBA and be able to use any other active-X control while
not having to deal with longer VBA code to do the simplest of things. Lispers
can have their cake and eat it too.
4. Lisp is harder than VBA to learn yet still far easier than C or C++.
This is nonsense. Lisp has far fewer syntax rules to remember than VBA. I have
taught people in an hour to write simple Lisp programs, not so for VBA. In the VB
class I took I estimate that people struggled an average of 2 or 3 times the amount
http://www.afralisp.com/newsletter/2003/2003-23.htm (8 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
of class time to do equivalent coding to what they could have accomplished in Lisp.
In fact, almost every Lisper I have known that later went on to VBA complained
about how much longer it was taking them to learn the language compared to what
it took them for Lisp.
5. Parens make you happy (oh look here come the men in white coats for you now)
Parens do make me happy, I always know what expression is modifying what other
expression. I don’t have any rules of precedence to remember and I always know how
to write a function because they are all written the same way. Why does this criticism
of Lisp always come from people who have to type 6 times the amount of code and
make all sorts of declarations with gobbledygook lingo that the Lisper is thankfully
spared from?
Yes, if you want to interact with ACCESS then VBA is the better choice. Most real world
code does not involve massive computation or interacting with dozens of other application
Computers are fast enough now that only very intensive operations ever demand that a user
gravitate to VBA or ObjectARX. If Autodesk would give users full-fledged Common Lisp inst
of VBA then we would really have something. One can even get around ObjectARX by buying
SharpLISP, writing their code in Lisp and having it translated into ObjectARX code.
Jeremy Dunn
============
thpthkbbthpf
Joe Willis
=========
ello
sorry for my very bad english.
I have a little lisp routine who change all the blocks in a file
to color "ducalque".
(defun c:ccbl ()
(command "-calque" "co" "8" "*" "")
(command "chprop" "tout" "" "co" "ducalque" "")
(setq coul 256)
(setq entbl0 (tblnext "block" T));;on recupere la liste de definition du
1er bloc de la table des blocs
(while entbl0
(setq nombl0 (cdr (assoc -2 entbl0))); On extrait le nom de la première entité
(print nombl0)
(while nombl0
(setq AncLst (entget nombl0))
(if (assoc 62 AncLst)
(setq NvLst (subst (cons 62 Coul) (assoc 62 AncLst) AncLst))
(setq NvLst (cons (cons 62 Coul) AncLst))
);;if
(entmod NvLst) ; Mets à jour l'entité ds la déf. de bloc
(setq nombl0 (entnext nombl0))
);;while
(command "_REGEN")
);;;*********************
;;(defun CHGC (noment);; / NomEnt LstEnt NomBloc DefBloc Coul AncLst NvLst)
http://www.afralisp.com/newsletter/2003/2003-23.htm (10 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
;; (setq
;; ;;NomEnt (car (entsel "\nSélectionnez une insertion de bloc: "))
;; LstEnt (entget NomEnt) ; On récupère la liste de définition de l'entité INSERT
;; NomBloc (cdr (assoc 2 LstEnt)) ; On extrait le nom du bloc
;; DefBloc (tblsearch "BLOCK" NomBloc) ; On récupère la liste de définition du BLOC
;; NomEnt (cdr (assoc -2 DefBloc)) ; On extrait le nom de la première entité
;; ;;Coul (acad_colordlg 0)
;; coul 256
;; )
;; (while NomEnt
;; (setq AncLst (entget NomEnt))
;; (if (assoc 62 AncLst)
;; (setq NvLst (subst (cons 62 Coul) (assoc 62 AncLst) AncLst))
;; (setq NvLst (cons (cons 62 Coul) AncLst))
;; )
;; (entmod NvLst) ; Mets à jour l'entité ds la déf. de bloc
;; (setq NomEnt (entnext NomEnt))
;; )
;; (command "_REGEN")
;; (princ)
;;)
;CODING ENDS HERE
===================
Hi!
Do you have or do you know where i find some arx tutorial?
Pablo Barbosa
============
Firstly great site - I'm now writting and adapting lisp routines on as small scale.
Currently trying to write one that will give a simplified plot interface for our office.
Have looked at your example but would like to be able to select multiple layouts
at the same time. How can I list the layout tabs in the drawing?
Mark Shinkfiled
=============
Is it possible to create a popup list in which you can enter a text as well ??
(in case the list does not contain the right option)
Jaap Sluis
==========
http://www.afralisp.com/newsletter/2003/2003-23.htm (11 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
Kirk Crawford
===========
Hi Kenny:
Thanks for the Newsletter, its very interesting and I'm receiving it normally.
I have one question maybe somebody in the net can help out with this: the
case is there is a cadastral maps which has been created along the time
(many years- about 500K parcels); the parcels in some cases as normal has
been created using polylines, but some of them (quite large number) has been
created using polyface meshes - don´t know why, and I simply do not understand
this crazy fact-, this off course create a lot of problems like file size, migration
problems to other software, applications development issues, etc. etc.. The need
of help is to convert the polyface meshes into standard colse polyline. I was be
able to get all the coordinates list but did not be able to found the logic to order
the points list so create a polyline from them. Has some body face wth this problem
so can provide some help or aoe idea on how to solve this?
Thanks in advance,
Alberto
======
Ramon Triana
=============
It offers more support which will prevent a woman's breasts from bouncing around,
and will keep her nipples hidden.... even in cold temperatures....
After announcing his invention, the scientist was taken outside where a large group
of men beat the sh*t out of him.
---------------------------------------------------------
http://www.afralisp.com/newsletter/2003/2003-23.htm (13 of 14) [23/03/2005 05:49:35 p.m.]
AfraLisp Newsletter No 2003-23
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
The More you Drink, the Better We Sound!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
To subscribe or unsubscribe to the AfraLisp
Newsletter pop along here:
http://www.afralisp.com/newsletter/newsletter.htm
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
=========================
AfraLisp Newsletter No 2003-24
=========================
Tuesday 21th October 2003
=========================
http://www.afralisp.com
mailto:[email protected]
=========================
AutoCAD to PDF?
Pop along to CADzation
http://www.cadzation.com
***********************************
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
=========================
"Bother", said Pooh, as he loaded his last round.
=========================
Next week I'm off on business to Johannesburg and then Cape Town.
I arrive back in Oranjemund on the Thursday and immediately leave for
Windhoek to participate in the "Rock Festival" with the band.
(participate!! - more likely all-fall-down.)
Anyway, because of this punishing schedule of drinking and general
debauchery, I'm afraid there will be no Newsletter next week!!
Sorry about that, but beer drinking and music tends to come first.
Oh, and my wife has gone to visit her mother in Plettenberg Bay
so I'm a "bachelor" for a few weeks. :-))))))))))))))))))))
http://www.afralisp.com/newsletter/2003/2003-24.htm (1 of 32) [23/03/2005 05:49:38 p.m.]
AfraLisp Newsletter No 2003-24
=================
Pearls of Wisdom
===============
98% of all constipated people don't give a crap
===============
Coding
=======
Kenny
Having found your site a while ago I now find it a great source of
information. I'm not in the league of some of the guys who use it but I at
least try to keep informed of some of what's happening.
Anyway the time has come to repay some debts and I've included 2 routines I
find useful. Being an amateur there may be better ways of writing these, but
since I'm not getting paid for this and they work for me, they'll do!
One is an automatic layer creation routine, and the other a dimension style
routine.
I'd appreciate any comments you have.
Cheers
Paddy
======
And here's the automatic layer creation routine :
xx : dialog {
label = "Structural Layering Routine";
: text {
label = "Version 2.0 by P Cooney";
}
:column {
: boxed_column {
label = "Element";
: list_box {
key = "element";
width = 15;
height = 10;
}
} //close boxed column
: toggle {
key = "reinf";
label = "Reinforcement";
}
}//colse column
: boxed_column {
label = "Sub Elemnent";
: list_box {
key = "subelement";
width = 15;
height = 22;
}
} //close boxed column
: boxed_column {
label = "Line Weight";
: list_box {
key = "lineweight";
width = 15;
height = 22;
}
} //close boxed column
: boxed_column {
label = "Line Type";
: list_box {
key = "linetype";
width = 15;
height = 22;
} // close row
ok_cancel_help;
: errtile {
width = 5;
}
(setq WHAT_NEXT 2)
(while (>= WHAT_NEXT 2)
(start_list "element")
(mapcar 'add_list el-list)
(end_list)
(start_list "lineweight")
(mapcar 'add_list lineweight-list)
(end_list)
(start_list "linetype")
(mapcar 'add_list linetype-list)
(end_list)
(unload_dialog dcl_id)
(do_lineweight)
(do_linetype)
(do_subelement)
(do_layer-construct)
)(PRINC)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_element-list()
;CONCRETE
(if (= sub_el-list_type 0)
(progn
(setq el "c")
(setq subel-list (list "CONCRETE" "Abutment" "Approach Slab" "Barrier" "Beam"
"Bearing" "Blinding" "Box" "Column" "Deck" "Footing" "Grout" "Headstock"
;STEEL
(if (= sub_el-list_type 1)
(progn
(setq el "s")
(setq subel-list (list "STEEL" "Beam" "Bolt" "Brace" "Caldding" "Column"
"Fly Bracing" "Hanger" "Panel" "Pipe" "Pile" "Purlin" "Railings" "Stair"
"Strut" "Truss"))
(start_list "subelement")
(mapcar 'add_list subel-list)
(end_list)
);end progn
)end if
;FURNITURE
(if (= sub_el-list_type 2)
(progn
(setq el "f")
(setq subel-list (list "Barrier" "Bus Stop" "Fence" "Lightpole"
"Sign" "Traffic Light" ))
(start_list "subelement")
(mapcar 'add_list subel-list)
(end_list)
);end progn
)end if
;STANDARD
(if (= sub_el-list_type 3)
(progn
(setq el "")
(setq subel-list (list "_barscale" "_dims" "_grid" "_hatch" "_legends"
"_notes" "_rev" "_schedules" "_symbols" "_text" "_text18" "_text25"
"_text30" "_text35" "_text50" "_text70" "_xref" "defpoints" ))
(start_list "subelement")
(mapcar 'add_list subel-list)
(end_list)
);end progn
;LINE
(if (= sub_el-list_type 4)
(progn
(setq el "line")
(setq subel-list (list ))
(start_list "subelement")
(mapcar 'add_list subel-list)
(end_list)
);end progn
)end if
)(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_rein()
(setq rein (get_tile "reinf"))
(if (= rein "1")(setq reinf "-reinf" ))
(if (= rein "0")(setq reinf "" ))
)(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_lineweight()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_linetype()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_subelement()
(setq prefix "st_")
(cond
((= sub_el-list_type 0) (do_concrete))
((= sub_el-list_type 1) (do_steel))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_concrete()
(cond
((= subelement 0) (setq sub-el "-conc"))
((= subelement 1) (setq sub-el "-abut"))
((= subelement 2) (setq sub-el "-aslab"))
((= subelement 3) (setq sub-el "-barrier"))
((= subelement 4) (setq sub-el "-beam"))
((= subelement 5) (setq sub-el "-bearing"))
((= subelement 6) (setq sub-el "-blinding"))
((= subelement 7) (setq sub-el "-box"))
((= subelement 8) (setq sub-el "-column"))
((= subelement 9) (setq sub-el "-deck"))
((= subelement 10) (setq sub-el "-footing"))
((= subelement 11) (setq sub-el "-grout"))
((= subelement 12) (setq sub-el "-headstock"))
((= subelement 13) (setq sub-el "-pier"))
((= subelement 14) (setq sub-el "-pile"))
((= subelement 15) (setq sub-el "-pilecap"))
((= subelement 16) (setq sub-el "-retwall"))
((= subelement 17) (setq sub-el "-slab"))
((= subelement 18) (setq sub-el "-stair"))
((= subelement 19) (setq sub-el "-wall"))
)
)(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_steel()
(cond
((= subelement 0 ) (setq sub-el "-steel"))
((= subelement 1 ) (setq sub-el "-beam"))
((= subelement 2 ) (setq sub-el "-bolt"))
((= subelement 3 ) (setq sub-el "-brace"))
((= subelement 4 ) (setq sub-el "-cladding"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_furniture()
(cond
((= subelement 0 ) (setq sub-el "-barrier"))
((= subelement 1 ) (setq sub-el "-bus stop"))
((= subelement 2 ) (setq sub-el "-fence"))
((= subelement 3 ) (setq sub-el "-lightpole"))
((= subelement 4 ) (setq sub-el "-sign"))
((= subelement 5 ) (setq sub-el "-trafficlight"))
)
)(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_standard()
(setq ltype "")(setq lw "")(setq prefix "")
(cond
((= subelement 0) (setq sub-el "_barscale"))
((= subelement 1) (setq sub-el "_dims"))
((= subelement 2) (setq sub-el "_grid"))
((= subelement 3) (setq sub-el "_hatch"))
((= subelement 4) (setq sub-el "_legends"))
((= subelement 5) (setq sub-el "_notes"))
((= subelement 6) (setq sub-el "_rev"))
((= subelement 7) (setq sub-el "_schedules"))
((= subelement 8) (setq sub-el "_symbols"))
((= subelement 9) (setq sub-el "_text"))
((= subelement 10) (setq sub-el "_text18"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_line()
(setq sub-el "")(setq prefix "")
)
(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_layer-construct()
(progn
(setq nlayer (strcat prefix el sub-el reinf lw ltype))
(command ".layer" "m" nlayer "c" colour "" "lt" linetype "" "")
);end progn
(prompt "\n Layer ") (princ nlayer) (prompt " is the current layer.")
)
(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun do_help (/ alrt1 alrt2 alrt3 alrt4 alrt5 alrt6 alrt7 alrt8 alrt9
alrt10 alrt11 alrt12 alrt13)
(setq alrt1 "\nLayer construction built on following convention.")
(setq alrt2 "\nPrefix of 'st_' denotes structural layer")
(setq alrt3 "\ncolumn 1 - denotes element category")
(setq alrt4 "\ncolumn 2 - denotes sub element category")
(setq alrt5 "\ncolumn 3 - denotes line weight")
(setq alrt6 "\ncolumn 4 - denotes line type")
(setq alrt7 "\n\nReinforcement check box adds annotation of 'reinf'")
(setq alrt8 "\nto layer name to denote reinforcement layer")
(setq alrt9 "\n\nPreferably always check one item in each column.")
(setq alrt10 "\n")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This how i do it
My blocks are build up from 2 blocks 1 grapic block (used for trim function) a
nd the final block with attributes end the grapical block the grapical block has
the same name as the final block with "G_" in front of it, so as the final block is
named "VALVE" the grapic block is named "G_VALVE"
(example block T9Y1100.dwg)
When this function is called after inserting a block it first finds out wich block
was inserted last then it chesk's if this block has a grapical block if so it inserts
the grapical block and draws a boundery box around it this boundery box is
used as a fence for the trim function both vertical as horizontal
;*************************************************************************************
;************ extra trim functie die lijnen onder geplaatste blokken trimt************
;************ 11-02-2002 rfheme ************
;*************************************************************************************
;---------------------------------------------------------------------
;hulpfunctie t.b.v. insbreek_S (slaat de naam op van het geplaatse blok)
;---------------------------------------------------------------------
(defun breek_sym_S()
;*******************************************************************
;BLOK NAAM OPVRAGEN VAN LAATST GEPLAATSTE SYMBOOL
;*******************************************************************
(Setq LAST_BLOCK_NAME (CDR(ASSOC 2 (ENTGET(ENTLAST)))))
;************************************************************************
;INSERTIE PUNT OPVAGEN VAN LAATST GEPLAATSTE SYMBOOL
;************************************************************************
(Setq INS_POINT(CDR (ASSOC 10(ENTGET(ENTLAST)))))
(setq ins_x (nth 0 ins_point))
(setq ins_y (nth 1 ins_point))
)
;---------------------
;hoofdfunctie insbreek_S
;---------------------
(defun INSBREEK_S ( / vname minExt maxExt)
(vl-load-com)
(setq old_osmode (getvar "osmode"))
(setvar "osmode" 0)
;**********************************************************
;BLOK NAAM GRAFISCH SYMBOOL SAMEN STELLEN
;**********************************************************
(if (/= (getvar "users5") "Nothing")
(progn
(Setq GR_BLOCK_NAME_1 (STRCAT LAST_BLOCK_NAME "_G"))
(Setq GR_BLOCK_NAME_2 (STRCAT "G_" LAST_BLOCK_NAME))
)
(progn
(Setq GR_BLOCK_NAME_1 (STRCAT "Nothing" "_G"))
(Setq GR_BLOCK_NAME_2 (STRCAT "G_" "Nothing"))
(setvar "users5" "Ok")
;**************************************************************
;Nagaan of het laatst geplaatste een grafisch blok bevat
;**************************************************************
(setq GR_BLOK_1 (tblsearch "block" GR_BLOCK_NAME_1))
(setq GR_BLOK_2 (tblsearch "block" GR_BLOCK_NAME_2))
(if (/= GR_BLOK_1 nil)
(setq GR_BLOCK_NAME GR_BLOCK_NAME_1)
)
(if (/= GR_BLOK_2 nil)
(setq GR_BLOCK_NAME GR_BLOCK_NAME_2)
)
(IF (or (/= GR_BLOK_1 nil)(/= GR_BLOK_2 nil))
(Progn
;************************************************************
;GRAFISCH BLOK INSERTEN t.b.v. BREKEN VAN DE LIJN
;************************************************************
(COMMAND "-INSERT" GR_BLOCK_NAME INS_POINT "1" "1" "0.0")
;*********************************************************************************
******************
;Maxext is het punt dat de breedte van het symbool aan geeft op lijn met het
insertie punt
;*********************************************************************************
******************
(setq maxExt (vlax-safearray->list maxExt))
(Setq max_x (nth 0 maxExt))
(Setq max_y (nth 1 maxExt))
;**************************************
;Grafisch symbool weer weghalen
;**********************************************************************************
;Selectiepunt samenstelen t.b.v. trimmen van de lijnen onder het symbool
;**********************************************************************************
(Setq F_POINT_1 (Strcat (RTOS(+ MIN_X (/ (- MAX_X MIN_X) 2))) "," (RTOS MAX_Y)))
(Setq F_POINT_2 (Strcat (RTOS(+ MIN_X (/ (- MAX_X MIN_X) 2))) "," (RTOS MIN_Y)))
(Setq F_POINT_3 (Strcat (RTOS MAX_X) "," (RTOS(+ MIN_Y (/ (- MAX_Y MIN_Y) 2)))))
(Setq F_POINT_4 (Strcat (RTOS MIN_X) "," (RTOS(+ MIN_Y (/ (- MAX_Y MIN_Y) 2)))))
(Setq I_POINT (STRCAT (RTOS INS_X) "," (RTOS INS_Y)))
(= I_POINT F_POINT_4))
(PROGN
(COMMAND "Trim" "L" "" "F" minExt maxExt "" "")
)
(PROGN
(COMMAND "Trim" "L" "" "F" F_POINT_1 F_POINT_2 "" "F" F_POINT_3 F_POINT_4 "" "")
)
)
(COMMAND "-Layer" "U" "insbreak" "")
Working with maps in Autocad, I repeatedly have the problem of some idiot
inserting the same block (say a street name) in the exact same spot multiple
times. It creates a real hassle when you move one block out of the way only
to discover 3 more underneath. I wasn't able to find any routines to fix
this problem, so I wrote my own.
David Weffald
============
;; Main Program
(SetVar "CMDECHO" 0)
(setq ctr 0)
(setq sslen(sslength ss_blocks))
;; Free up memory
(setq a1 nil
ang nil
blk_ctr nil
blk1 nil
chk_a1 nil
chk_ang nil
chk_blk_ctr nil
chk_coords nil
chk_e1 nil
chk_i1 nil
chk_name nil
coords nil
ctr nil
dup_obj nil
e1 nil
eval_ctr nil
i1 nil
is_blk nil
name nil
rotation nil
ss_blocks nil
ss_chk_entity nil
ss_chk_name nil
(SetVar "CMDECHO" 1)
(princ)
);; end defun DUPBLKF
(princ)
;CODING ENDS HERE
==================
Scenario :
You are working in Model Space and decide that you
need to enlarge or reduce a certain portion of your drawing
to create a detail view. Unfortunately, your dimension values
will now all be changed according to the scale value you choose.
This wee program will help alleviate that.
Simple, but it works and could even be expanded upon.
Any suggestions/volunteers???
scaledim : dialog {
label = "Detail Scale Dim";
: column {
: boxed_radio_row {
fixed_height = true;
label = "Scale Type :";
: radio_button {
label = "&Enlarge";
key = "rb1";
value = "1";
}
: radio_button {
: spacer {
}
: edit_box {
label = "&Scale Factor :" ;
key = "eb1" ;
edit_width = 8 ;
: spacer {
}
: boxed_row {
label = "New Scale :";
: text_part {
key = "txt2";
}
: button {
key = "nscale";
label = "&Calc...." ;
fixed_width = true;
}
: spacer {
}
: boxed_row {
label = "Drawing Scale :";
: text_part {
key = "txt1";
}
: spacer {}
:spacer { width = 1;}
ok_cancel ;
(setq userclick T)
(setq scaletype "up")
(action_tile "rb1"
(action_tile "cancel"
"(done_dialog)(setq userclick nil)")
(action_tile "accept"
(strcat
"(progn (setq nscale (atof (get_tile \"eb1\")))"
"(done_dialog) (setq userclick T))")
)
(action_tile "dscale"
"(setvar \"DIMLFAC\" 1.0) (set_tile \"eb1\" \"1\") (calcscale) ")
(action_tile "nscale"
"(calcscale)")
(start_dialog)
(unload_dialog dcl_id)
(if userclick
(progn
);if
);progn
);if
(princ)
);defun
);if
;;;*-------------------------------------------------------------------------
(princ)
Kenny,
I was reading your tutorial on Bulges,
http://www.afralisp.com/lisp/Bulges1.htm
and remembered I had these maths functions.
I think someone will find them very usefull.
Mike
=====
**************************
*****Joop Moelee*****
mailto:[email protected]
**************************
*********CADzation************
http://www.cadzation.com
***********************************
for their generous sponsorship of this competition.
***********************************
This will dump all properties of all the Layer objects in your
drawing to the console screen.
================
Methane began to build up below decks and the first time someone came below
at night with a lantern, BOOOOM! Several ships were destroyed in this manner
before it was determined just what was happening. After that, the bundles of
manure were always stamped with the term "Ship High In Transit" on them which
meant for the sailors to stow it high enough off the lower decks so that any water
that came into the hold would not touch this volatile cargo and start the production
of methane.
Thus evolved the term "S.H.I.T," which has come down through the centuries and
is in use to this very day. You probably did not know the true history of this word.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
If you enjoy superb music, visit :
"BedRock - The Band in the Sand"
If you can still hear the music, it's not loud enough!
http://www.BedrockBand.com
----------------------------------------------------------
AfraLisp is generously supported by :
"Corbimite.com"
http://www.corbimite.com
----------------------------------------------------------
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------------------------------
AfraLisp Newsletter No 2002-01
--------------------------------------------------
Thursday 3rd January 2002
--------------------------------------------------
http://www.afralisp.com
mailto:[email protected]
--------------------------------------------------
AfraLisp is supported by :
"Contract CADD Group"
http://www.contractcaddgroup.com
--------------------------------------------------
Have you visited this site yet?
http://www.cadchat.com
--------------------------
The Front Stoep
--------------------------
Welcome to the year 2002. I hope you had a jolly Xmas and New Year. I
know I did, or so my wife tells me!!! (Hey, I didn't get arrested this
year). I've got a lot in store for this next couple of months. I'm going to
be looking at Visual Lisp and attributes, followed by getting AutoCAD
to talk with other applications such as Excel and Access using Visual
Lisp. And then I'm going to have a wee peek at dictionaries. End of
January, the 2002 upgrades should have arrived, so I'll have that lot to
plough through and probably lot's of system tweeking to deal with.
On top of all that, we're just about to start recording the bands new CD.
So, I've got my work cut out for me, but it keeps me out of trouble. (and
the pub).
Anyway, enough waffle and on with the Newsletter.........
------------------------
The Site
------------------------
I've been a bit lazy over the festive season and didn't manage to do
much in the way of work. I started I don't know how many times, but
gave up after the second beer.
Anyway, not to worry, I'm back at work on Monday and will soon have
one or two new goodies written and posted.
-------------------------
Michael Demott has very kindly designed an AfraLisp Link button. So,
if you've got your own website, and would like to link to AfraLisp, you
can grab the button from here :
http://www.afralisp.com/images/afra-but.gif
-------------------------
I don't know if you've popped along to have a look at
http://www.cadchat.com yet, but it's well worth the visit. Most of you
should be familiar will Dave Whynot, but just in case you're not, here's
a brief bio :
David Whynot is the founder and owner of CADchat.com, an AutoCAD
hacker since 1988. He is the creator of the original CADsyst website
(now CADdepot - http://www.caddepot.com) which he still is involved
as librarian. David's "real" job is IT manager, website developer and
AutoCAD draftsman for Halsall Associates Ltd - http://www.halsall.com
, a consulting engineering firm. Self taught in the ways of AutoCAD,
website development and NT networking, David enjoys the opportunity
to learn from others, hence one of the reasons for creating
(unload_dialog dcl_id)
;unload
(if userclick
;check O.K. was selected
(progn
;if it was do the following
(setq SIZ (fix SIZ))
;convert to integer
(setq SIZ (nth SIZ NAMES))
;get the Day
(alert (strcat "You Selected: " SIZ))
;display the Day
);progn
);if userclick
(princ)
);defun
(princ)
;AUTOLISP CODING ENDS HERE
-----------------------------------------------------
Save this as "Popup.lsp"
Quite a few difficult questions this week, so come on folks, let's give
them a hand.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(action_tile "myslider"
;if user moves slider
"(slider_action $value $reason)")
;pass arguments to slider_action
(action_tile "eb1"
;if user enters slot length
"(ebox_action $value $reason)")
;pass arguments to ebox_action
(defun slider_action (val why)
;define function
(if (or (= why 2) (= why 1))
;check values
(set_tile "eb1" val)))
;update edit box
(defun ebox_action (val why)
;define function
(if (or (= why 2) (= why 1))
;check values
(set_tile "myslider" val)))
;update slider
(action_tile
"accept"
;if O.K. pressed
(strcat
;string 'em together
"(progn
(setq lngth (get_tile \"eb1\"))"
;get slot length
"(done_dialog)(setq userclick T))"
;close dialog, set flag
);strcat
);action tile
(action_tile
"cancel"
;if cancel button pressed
"(done_dialog) (setq userclick nil)"
;close dialog
);action_tile
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;unload
(if userclick
;check O.K. was selected
(alert (strcat "You Selected: " lngth))
;display the selected length.
);if userclick
(princ)
);defun
(princ)
;AUTOLISP CODING ENDS HERE
Save this as "Slide.lsp".
------------------------
The Questions
------------------------
Hi Kenny,
I'm one of the person who is getting benefited from your Afralisp site
for
autolisp & VBA. I'm currently working on Autocad2000 VBA.
I'm developing a VBA program for storing the entity properties in an
ExcelSheet. I have a block of 32 entities and I have to get the entity
property of a particular entity of the block. I don't want the block to be
exploded. I tried (as per your tutorial) in Autolisp & found it worked
well.
Is it possible to get the list properties of a selected entity of a block
in VBA? Or How can I manipulate the list properties of an entity in a
block?
Your advice in this regard is greatly appreciated.
Thanks,
Rajesh.
-------------------------------------------------
My problem is this, I have a number of drawings with hatched regions
shown.
Is there a LISP or VB program that can query these hatched regions
and
display their areas?
If not, is there a LISP or VB program where you can pick a point inside
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
);progn
);if
(princ)
);defun
(princ)
;AUTOLISP CODING ENDS HERE
Save this as "AddNote.lsp"
------------------------
The Questions
------------------------
I was looking at your website last night and all the
useful information that it has and I have a question
for you. This is going to be an awkward question,
but I was wondering if you would/could send me all of
your tutorials on your site for my own reference rather
than me having to copy and paste them. I would
greatly appreciate and wouldn't hesitate to return the favor
if asked. Keep up the good work. Thank you.
Mark
I've been thinking about this.
How does an electronic book sound?
PDF format?
Let me know everyone.
Then I'll think about it some more!!
-----------------------
Hi Kenny,
I was hoping you could help me finish my first lisp?
I am using 2002 and the lisps does work but not 100%.
When the lisp has finished and I have enter my text info, the inserted block
shows the following:
attedit for Qty,
n for Genus & Species, and
n for Size
I also don't know how to have it ask for the scale factor I.E. 96 for 1/8",
240 for 20 scale.
If you can help, I would be grateful
thanks,
Kyle Crooke
hi Kenny...
i would like to know what wrong with this....
(defun c:fss ()
(setq fich1 (getfiled "Ouvrir un Nouveau Plan:" "" "dwg" 8))
(setvar "filedia" 0)
(command "filedia" "0" "open" fich1)
(setvar "filedia" 1)
)
is not working......why ???
Andrea Andreetti
-----------------------
Kenny
Try this. Copy drawing from Acad2002 into PowerPoint. I am using
---------------------------
The Back Stoep
---------------------------
This weeks Back Stoep is a couple of contributions from you.
First one from Pete Willem :
A man runs home and bursts in yelling :
"Pack your bags sweetheart, I've just won the lottery, all six numbers!"
She says :
"Oh wonderful! Should I pack for the beach or the mountains?"
He replies :
"I don't care ... just pack and shove off!"
-------------------------------
Gabriel Calós De Vit sent me this little gem. He did ask me to correct the
grammar, etc, but I think it's a cracker just as is.
Once upon a time a little fox terrier dog get lost at the middle of the jungle.
Looking the way to going back home, he see a pair of red eyes surrounded by
a black head.
It was a big black panther.
The dog feel that he will be the panthers breakfast, so looking for a help he
take an old bone from ground and chewing it say, "Oh , what a good panther I
had for breakfast!"
Seeing this, the panther goes back step to jungle, but as always is, a little
monkey see the scene and going after the panther he reach and tell him about
the dog´s trick.
The panther said, "I go back where the dog is and this time I will eat him".
The monkey ask to ride the panther so he will see how it will happen.
The litle dog was still lost but he see the panther with the monkey coming to
him.
Giving his back to them , the dog says, "I wonder where damm is the monkey.
About half an hour I ask him to bring me another panther for lunch.!!!!!!!!!!!!!"
Thanks Gabriel, and no offence meant. I wish I could speak Argentinouwenies
as well as you speak English.
Tara the noo,
Kenny Ramage Q.B.E.
---------------------------------------------------------
AfraLisp : http://www.afralisp.com
---------------------------------------------------------
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
----------------------------------------------------------
To unsubscribe send e-mail to
mailto:[email protected]?subject=Unsubscribe
stating your reasons in not less than 1000 words.
We will then hunt you down and make you
change your mind.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Mark
----------------
First you would need to create a block containing additional attributes
other than the 3 attributes, namely "Date", "Time" and "Who By", called
for
in the tutorial.
Let's name these two attributes "Drg" and "Note".
To retrieve that drawing name and path, use the following :
(setq drg (strcat (getvar "dwgprefix") (getvar "dwgname")))
To get a custom string from the user, do this :
(setq note (getstring T "\nEnter Note : "))
Now add the 2 new attribute variables to the (command) function :
(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby drg
note)
To specify the text to use, you would accomplish this when you create
the
attribute.
----------------------
P.S. What goes "Mark, Mark?
A dog with a lisp!!!
----------------------
Kenny,
I've on to your web site since the beginning, and haven't asked any
questions. Well that's changed now. I'm attempting to create a lisp
routine
to set a standard dimension style, make a layer for it and a certian style
of text. My routine runs through fine if the style exists and is currently
set. If I run it on a new drawing it works fine except it creates the
Dimstyle as an override. If run the routine and the dimstyle is not
current,
errors out on me. Any suggestions for this type of lisp checking for
dimstyles?
I'm using ACAD 2002 and would like this routine to be accessed
through a
toolbar so that everyone in the office can have access to it.
Thanks
Mark Bross
-------------------
Mark,
Another dog with a lisp!!! To check for the existence of a Layer, Style
or a
Dimstyle can be achieved in a couple of ways. To achieve it using plain
old
AutoLisp and the (tblsearch) function, have a look here:
Working with Layers, DimStyles and Styles
http://www.afralisp.com/lispa/lisp31.htm
eg.
(defun C:Lon ()
Kenny,
My wife also thinks you're weird.
She just don't standunder.
She thinks that I'm lysdectic.
Les
---------------------------
The Back Stoep
---------------------------
In my teens, I lived in Zambia for quite a few (interesting) years. There,
the local brew (beer) was known as "chibuku". The locals though,
never
referred to "chibuku" as a drink, but rather as animals! This used to
confuse me terribly until the day I plucked up some courage and
declared my
ignorance by asking the question........
What are "chibuku?"
"Chibuku" are really cute little animals with an intoxicating, liquid gait
*****************************************************************************
The information contained in this e-mail is confidential and may
be subject to legal privilege. If you are not the intended recipient,
you must not use, copy, distribute or disclose the e-mail or any
part of its contents or take any action in reliance on it. If you have
received this e-mail in error, please e-mail the sender by replying
to this message. All reasonable precautions have been taken to
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------------------------------
AfraLisp Newsletter No 2002-05
--------------------------------------------------
http://www.afralisp.com
mailto:[email protected]
--------------------------------------------------
This line has writing in it.
--------------------------------------------------
Have you visited here yet?
VBA Expresso
"Lost in Stupid Parenthetheeth"
http://www.vbdesign.net/~rrath/cgi/ikonboard/ikonboard.cgi
If not, Why not?
-------------------------------------------------
AfraLisp is supported by :
"Contract CADD Group"
http://www.contractcaddgroup.com
--------------------------
The Front Stoep
--------------------------
Here's a wee bit of advice that was given to me by a wrinkled, grey
haired, old man who turned out to be twenty three and died a year later
from a mixture of rattlesnake poisoning and cirrhosis of the liver :
"Always have a bottle of whiskey in your pocket in case of snakebite.
Furthermore, always have a small snake in your other pocket."
------------------------------------------------------------------
On his death bed, his last words to me before he shuffled off the mortal
coil were, "Always be prepared".
To be honest, what he really said was,
"Ulfaays pee prapaairet - hicc".
------------------------------------------------------------------
So, I'm going to take his advice and ask you to participate in a bit of a
survey.
There are lot's of AutoCAD newsletters like this this, and quite few
sites like AfraLisp.
I would like to ask you what you DO NOT like about them. You don't
have to go into heavy details and that sort of thing, but I would
appreciate if you would let me know your thoughts and feelings. I
promise to publish the lot, warts and all. (I'll only take out the swear
words.) So, come on, let me know what you really think. Pass this on to
your friends and colleagues. If they don't have access to email, don't
worry! Ask them to write their comments on the back of a postcard,
stick a stamp on, make their way to to an Internet Cafe, copy what
they've written on the postcard into email, and then send it to me.
Simple hey?
-------------------------------------
Quotation of the Week
-------------------------------------
I am not a vegetarian because I love animals;
I am a vegetarian because I hate plants.
------------------------
The Site
------------------------
I've finally finished with the technical update on the site (phew-wipe's
sweat off brow). The indexing is now working, so you should be able to
search the site correctly, or should I say, get meaningful results from
the search. As well, the Site Map is catalogued, which should make the
site a lot easier to navigate. http://www.afralisp.com/sitemap.com
---------------------
Hi Kenny,
I saw my remark about the Arabic CAD website in your newsletter. I
became very popular these days. This is the second time you publish
my name in your newsletter. THANX
I have a little question :
First take a look at this code;
;CODING STARTS HERE
(defun QQQQ ()
(princ "\nThis is function QQQQ")
(princ)
)
(defun I_do_not_know_how ()
(setq var1 "QQQQ")
;;; I want to call QQQQ using the variable var1
;;; var1 holds the name of the function I want to call
;;; an urgent call to Kenny :-)
(princ "\nIs there a way to do this ? ")
(princ)
)
;CODING ENDS HERE
Is my question clear ?
By the way I am using AutoCAD 2002
Yours
Sherko
---------------------------
First we need to rewrite the QQQQ function :
(defun QQQQ (message )
(princ message)
(princ)
)
Load "QQQQ" into AutoCAD.
Mike Perry
--------------------------
Funny, when I was in Kenya the brew of choice(?) was Tuskers.
Garry
------------
Nice beer, I've had a few gallons of that.
--------------------------
;;;REVIEW STARTS HERE;;;
William Kishonti asked me to have a look at this. I didn't have much
time, but it's well worth trying out. Pop along and and have a look at
the demo version. Unfortunately, he wants money for the real thing :-(((
Hurricane PowerTool for AutoCAD
http://www.74mph.coat
;;;REVIEW ENDS HERE;;;
---------------------------
The Back Stoep
---------------------------
The Top 5 Reasons Dogs Don't Use Computers
20) Can't stick their heads out of Windows 2000.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
"You can't be a real country unless you have a national beer and a
national airline.
It helps if you have some kind of a football team, or some nuclear
weapons, but at the very least you need a beer".
Frank Zappa
------------------------
The Site
------------------------
With a lot of help and input from a lot of people (this means I
"borrowed" most of it), I've added a complete listing of AutoCAD
System Variables for your reference.
http://www.afralisp.com/lisp/acadvar.htm
If you would like to print it out and have it next to you whilst you
whistle and work, you can download the list in PDF format :
http://www.afralisp.com/zip1/acadvar.zip
Or, in RTF format :
http://www.afralisp.com/zip1/acadvar1.zip
Now don't say I'm not nice you!!
------------------------
Want to Load and Run an AutoLisp routine from VBA?
Sub RunLisp()
ThisDrawing.SendCommand "(Load ""Alispfile"")" & vbCr & "Alispfile"
& vbCr
End Sub
------------------------
The Questions
------------------------
Hi Kenny,
Thanks for all your efforts on your website Afralisp. It is so good to be
able to find out quality info on Autocad.
I have a question to ask you in regards to Autocad 2000, I am trying to
find out some information on how to go about designing a program to
perform automated parts nesting and G code production for use with a
cnc cutting machine. I have done some searching on the web and have
found several stand alone programs but I have not been able to find
out how they work or even how they operate in principle. I was hoping
that you might have had some experience with this in the past or knew
someone who could explain the algorithm to me. I understand how a
manual nest can be created from ployline shapes inserted onto a
Mark.
Have a look at this Batch Slide application. It should be simple enough
for a man of your calibre and good looks to modify the coding to bind
any xrefs in the drawing instead of making slides. Any problems, drop
me a line.
(it's a pity you can't e-mail six packs!!)
http://www.afralisp.com/lispa/lisp59a.htm
----------------------
Hi Kenny,
You articles and tutorials are great! I have made several routines that I
couldn't have made without you tutorials.
I'm still using AutoLisp for some (small) routines that I make.
Now I'm trying to make a routine that will read data from an Ascii-file
and inserts it in the drawing. ATOF does the job, but when I use
numbers like "201823.52" ATOF returns "201824.0" (yes, I see it's eight
places).
Is there a setting that I've missed?
Gerrit
Are you using the number for anything else than internal calculations?
ATOF returns the precise number but the display is limited to the
eternally irritating cut-offs (wasn't there once a sysvar that controlled
display of decimals?).
Try evaluating (- (atof "201823.52") (fix (atof "201823.52"))) - it should
return 0.52
Stig Madsen
----------------------
And to reinforce Stigs theorem :
----------------------
Help! I need a routine to draw a pline around an existing hatch that was
created with bhatch and consequently has no selectable boundary.
Bruce
-----------------------
;CODING STARTS HERE
(defun mosta-theway ()
(setq ENT (entget (car (entsel "\nPick hatch! :"))))
(setq POINTS (massoc 11 ENT))
(command "PLINE")
(foreach P POINTS
(command p)
);end foreach
(command "c" "")
);end defun
;MASSOC by Jaysen Long
(defun massoc (key alist / x nlist)
(foreach x alist
(if
(eq key (car x))
(setq nlist (cons (cdr x) nlist))
);end if
);end foreach
(reverse nlist)
);end defun
(princ)
;CODING ENDS HERE
Al Paca
----------------------
The Answers
-----------------------
Would you like a listing of AutoCAD User Groups?
Then make your way here :
AutoCAD Resource site
http://www.llpsite.com/
There's also LOTS more......
--------------------------
Note : A#
---------------------------
http://www.vbcity.com/page.asp?p=home
Free, :-)) but you will need to register.
----------------------------------------------------------
Peter Jamtgaard very kindly gave me permission to publish this.
Have you ever had a gazillion drawings open in mdi mode and just
wanted to shut down a bunch of them, but not all of them quickly.
This program displays a dialog box with all of the open acad
documents listed. You can multiple select the ones you want to close
and pick o.k. It has some kinda cool stuff in it for everyone.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Pierre Desmarais
------------------------
Pierre,
ThisDrawing.EraseAll
Sorry, now seriously :
This will erase everything except xrefs, active layer, active style, etc....
Public Sub EraseAll(Doc As AcadDocument)
Dim Entity As AcadEntity
Thanks man.
Jeff Crawford
-------------------------
The Answers
--------------------------
LISP developers, you can download at :
www.afitec.com/upload/texte_vecteur_demo.zip
a demo version of TEXTE_VECTEUR, a LISP routine to display any text string as vectors.
Use in your own programs to:
* display entities properties, such as layer, block name, lines length...etc
* display information or warning messages
* display points coordinates without the need to use ordinate dimensioning
Patrick EMIN
mailto:[email protected]
-------------------------
In you examples you repeatedly disable OSNAP by setting it's value to 0. a better way is
to add 16384 to the old OSNAP value, this merely turn OSNAP off ( the same as pressing
the OSNAP button or F3), setting the OSMODE system variable clears any settings, the
method below allows the user to quickly re-enble OSNAP if they wish rather than having
to reset the snap settings.
(setq osmode (getvar "osmode"))
;store existing OSNAP value
(if (< osmode 16384)
;tests if OSNAP enabled
(setvar "osmode" (+ osmode 16384))
;disables OSNAP
)
(setvar "osmode" osmode)
;resets OSNAP to original value OR
(if (> (getvar "osmode") 16384)
;test if OSNAP is enabled
(setvar "osmode" (- (getvar "osmode") 16384))
;enables OSNAP with current settings
)
Michel Loftus
--------------------------
Kenny,
I finished a good Beta of the hatch-pline routine...(an almost-there if you will)
It may be a bit long for the newsletter but feel free to post on your website or wherever...
Tony Lukasz
mailto:[email protected]
;CODING STARTS HERE
;Draws polyline boundaries around hatches.
;--------------------------------------------------------------------------
(defun c:hatch-pl (/ ent numpts plst osmo stpt lstpt arcflag pldat bdst mdpt bpt nxtpt
pllst)
(setvar "CMDECHO" 0)
(command "UNDO" "BEGIN")
(setq numpts -1 plst nil
osmo (getvar "OSMODE")
stpt nil lstpt nil
arcflag 0 *error* err1
ent (entsel "\nPick Hatch:")
)
(if ent (progn
(setq ent (entget (car ent)))
(setvar "OSMODE" 0)
(foreach pldat ent
(if (= (car pldat) 93)(progn
(if (= numpts 0)(if (= arcflag 1)(arc-sub)(vert-sub)))
(setq numpts (cdr pldat))
)
)
(if (and (= (car pldat) 10) (>= numpts 0))
(if (= arcflag 1)(arc-sub)(vert-sub))
)
(if (= (car pldat) 42)(progn
(if (= (cdr pldat) 0.0)(setq arcflag 0)
(setq arcflag 1 bdst (* 0.5 (cdr pldat)))
)
)
)
)
))
(command)
(command "UNDO" "END")
(setvar "OSMODE" osmo)
(setvar "CMDECHO" 1)
(prin1)
)
;--------------------------------------------------------------------------
(defun vert-sub ()
(setq numpts (1- numpts))
(if (>= numpts 0)
(if plst
(progn
(setq lstpt (cdr pldat))
(if (null stpt)(setq stpt (cdr pldat)))
(command lstpt)
)
(progn
(setq stpt (cdr pldat) plst 1)
(command "PLINE")
(command stpt)
)
)
(progn
(command stpt)
(command "")(command)
(setq pllst (entlast))
(setq numpts -1 plst nil stpt nil lstpt nil)
If Cray made toasters... they would cost $16 million but would be
faster than any other single-slice toaster in the world.
If Sony made toasters... the Toast-Man would barely be larger than
the single piece of bread it was designed to toast, and it could be
conveniently attached to your belt.
If IBM made toasters... they would have one big toaster where people
bring bread to be submitted for overnight toasting. IBM would claim a
worldwide market for five, maybe six toasters.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AND, why not join a pleasant and civilised conversation pertaining to AutoLisp :
http://www.vbdesign.net/~rrath/cgi/ikonboard301/ikonboard.cgi
Look for the "There is no VBA " Board...
--------------------------------
The Questions
--------------------------------
I'm trying to learn Autolisp and I would like to know how I should go about
remaning the layers in my drawings with a prefix or suffix. Would this be
better accomplished with VBA?
---------------
Liam,
No need to use VBA. Try this :
;CODING STARTS HERE
;This routine will place a Prefix in front of all Layer names
;and rename them.
;Of course, it will not rename Layer "0" or "Defpoints".
(prompt "\nType ChLayName to run.........")
(defun C:ChLayName ( / acadDocument theLayers layName)
(vl-load-com)
Has someone done a lisp which uses txt files as a database and can write this data into
attributes?
Tom
-------------------------
The Answers
--------------------------
Rotate All Blocks
Version 1.0
Written by: Steven Papke
Written on: 2/16/02
This routine asks the user to select a block. With the block name extracted, the user then
inputs the rotation angle and the routine will rotate all blocks of the same name.
;CODING STARTS HERE
(defun *error* (msg)
(setvar "osmode" osm)
(setvar "cmdecho" cme)
(princ "error: ")
(princ msg)
(princ)
)
(defun c:rab ()
(setq osm (getvar "osmode"))
(setq cme (getvar "cmdecho"))
(setvar "cmdecho" 1)
(setvar "osmode" 255)
(command "undo" "mark")
(prompt "\nSelect source block: ")
(setq bkpic (entsel))
(setq bkpicmod (car bkpic))
(setq bknam (cdr (assoc 2 (entget bkpicmod))))
(initget 1)
(setq rotang (getreal "\nRotation Angle: "))
(setq count 0)
(prompt "\nSelect block(s) to rotate: ")
(setq ss (ssget))
(if ss
(progn
(setq count 0)
(setq chgblk 0)
(setq ssl (sslength ss))
(princ "\nIsolating Block ")
(princ bknam)
(princ " from selection set.")
(princ "\n")
(setvar "cmdecho" 0)
(while (< count ssl)
(setq blk (entget (ssname ss count)))
(setq sinspt (cdr (assoc 10 blk)))
(setq sblk (cdr (assoc 2 blk)))
(if (= bknam sblk)
(progn
(if (/= (substr (cdr (assoc 2 blk)) 1 8) "*")
(command "ROTATE" (ssname ss count) "" sinspt rotang)
)
(setq chgblk (+ 1 chgblk))
)
)
(setq count (+ 1 count))
)
)
)
(princ ssl)
(princ " objects found.")
(princ "\n")
(princ chgblk)
(princ " blocks rotated.")
(setvar "osmode" osm)
Have you ever heard of a variable that will allow you to align text to a current ucs angle
and not the wcs. I have written a basic program to rotate text & mtext to zero angle, using
an entmod on assoc 50. The routine works a treat when set to world cs, but only the mtext
works in a user cs, the text still rotates as though wcs was set.
The code is below if anyone would find it useful:
Thanks
Dennis.
---------------------------
Kenny,
I sent you a lisp about a week ago from replacing old blocks with new ones. I made a
revision to include replacing blocks with attributes, and to replace the blocks but keep
their original scale factor. The blocks with attributes get inserted with the default value,
but I could change it to set the attributes to the value of the new blocks attribute. One
other
thing that I changed that I think you should consider covering is the (entselect) function I
created. It is a very useful global function to use for testing the object selection by the
;;===================================================================
;; Function is a front end Object Selection filter to help idiot proof some routines...
;; By Rodney Nelson C.D. - AutoLISP programmer/Drafter/Designer, need help
<[email protected]>
;;-------------------------------------------------------------------
;; BY : Rodney Nelson
;; CREATED : 02-22-02
;; DEFUN : (entselect)
;; VERSION : 1.0
;; COMMENTS :
;; OTHER : sample call - (entselect "TEXT" "you want to replace") - "TEXT" is kind
;; of object that you want to pick, "you want to replace" is the words that you want to
;; be prompted - will look like -> Select a TEXT, you want to replace:
;; The variable ENTITY is what you can use to get data (cdr (assoc 0 (entget (car ENTITY))))
;;===================================================================
;;===================================================================
;; Error checking routine
;;===================================================================
(defun error() ;load function
(prompt "\nGlobal Error Trap Loaded") ;inform user
(princ)
);defun
;;;*==========================================================
(setvar "cmdecho" 1)
(princ))
;CODING ENDS HERE
Adam Tullis
---------------------------
The Back Stoep
---------------------------
Mrs. Davidson's dishwasher quit working so she called a repairman. Since she had to go
to work the next day, she told him, "I'll leave the key under the mat. Fix the dishwasher,
leave the bill on the counter, and I'll mail you the check. By the way, don't worry about my
Doberman. He won't bother you. But, whatever you do, do NOT under ANY circumstances
talk to my parrot!"
When the repairman arrived at Mrs. Davidson's apartment the next day, he discovered the
biggest and meanest looking Doberman he had ever seen. But just as she had said, the
dog just lay there on the carpet, watching the repairman go about his business. However,
the parrot drove him nuts the whole time with his incessant yelling, cursing, and
name-calling. Finally the repairman couldn't contain himself any longer and yelled, "Shut
up, you stupid ugly bird!"
To which the parrot replied, "Get him, Spike!"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The Answers
Mark
---------------
Are you looking for a Japanese Visual Lisp site?
http://www1.harenet.ne.jp/~hanafusa/visual/#for
--------------------------
And here's some Free Stuff :
http://www.turvill.com/t2/Free_Stuff/Index.htm
--------------------------
I have written a routine in VBA that will insert multiple xrefs or blocks
and allow you to select the
insertion point as well as select if an xref is an overlay or attached.
Robert Endres
(setq N2 (+ N2 1))
);End of repeat bracket
(print MAXYPT)
; Create Upper Right Point
(setq MAXPT (list MAXXPT MAXYPT))
(command ".circle" MAXPT "1")
; Set system variables back to original values
(setvar "cmdecho" OLDCMDECHO)
(setvar "cmddia" OLDCMDDIA)
(setvar "filedia" OLDFILEDIA)
(setvar "osmode" OLDOSMODE)
(princ)
)
; End Main Function
--------------------------
Do you know that you can attach volumes of data to almost any object
that is stored with the drawing. No it's not XDATA!
Let's attach some LDATA to the Modelspace Object.
Note that we are not attaching the data to a line or a circle, but to
Modelspace!!!!
In this example, we'll attached four integer, three real numbers, two
strings,
and (a partridge in a dotted pair tree).
(Coding very kindly donated by Peter Jamtgaard)
----------------------------
;CODING STARTS HERE
(defun C:VL-PUT-LDATA (/ ACADOBJ CDWGOBJ MSPCOBJ)
(setq ACADOBJ (vlax-get-acad-object)
CDWGOBJ (vlax-get-property acadobj "activedocument")
MSPCOBJ (vlax-get-property CDWGOBJ "modelspace")
)
(vlax-ldata-put MSPCOBJ "test"
'( 1 2 3 4 1.0 2.0 3.0 "TEST" "TEST1" (0 . "INSERT"))
)
(vlax-release-object ACADOBJ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------------
The Site
--------------------------------
Ha, ha. I've finally got around to doing some work!!!
This week I've posted three, yes three, new Tutorials, all in the Visual
Lisp section.
'Cos I've been getting so many queries regarding Layers, I've posted a
complete section regarding Visual Lisp and Layers :
http://www.afralisp.com/vl/layers.htm and I decided to have a closer
look at Visual Lisp and Profiles :
http://www.afralisp.com/vl/profiles.htm
As well as that, I've also had a look at Visual Lisp and Attributes :
http://www.afralisp.com/vl/attab-vl.htm
So pop along and have a wee read. There's also a couple of nice
routines that you should find interesting. For example :
Here's a little application that you may find interesting. It will check the
Login Name of the user and automatically load the relevant Profile for
that user.
Firstly you need to name your Profiles the same as your Login Name.
e.g. if your Login Name is NDBE51D1, your Profile must be named
NDBE51D1.ARG. Then you need to store all your user Profiles in the
);if
);progn
;it is loaded but make the profile the Active Profile
(vla-put-ActiveProfile acadProfiles profilename)
);if
);progn
earv
----------------------------
I can certainly provide you with a list of Xrefs in your drawing :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------
The Front Stoep
--------------------------
Hi Everyone. Hope you're all fine and looking forward to a pleasant Easter
weekend. I just thought I'd give you a little bit of advance warning in that I'll be
going off on my holidays in just over a weeks time. This means that after next
weeks Newsletter, there will be no Newsletters for about 2 weeks.
More about that next week.
I'm not feeling all that great at the moment 'cos the bleedin Aussies have just
beaten us (South Africa) again at cricket. Ha, just wait, there are plenty of
matches left and revenge is sweet!!
(Australia - This is the land where men are men and the sheep are very
nervous!!!)
--------------------------------
Quote of the week
--------------------------------
Friends help you move.
Real friends help you move bodies.
--------------------------------
The Site
--------------------------------
I've had so many queries in regards to loading VBA files that I thought it was time
to have a close look at the subject. You can find what I've almost decided is
maybe, probably, could be the best way of achieving the aforemention task at :
http://www.afralisp.com/vl/vl-vba.htm
How does a Library of AutoLisp functions sound?
Not AutoLisp programs, functions/sub-routines.
You input and desirability in regards to this matter would be appreciated.
(In other words, let me know what you think).
--------------------------------
The Questions
--------------------------------
I apologize for insisting (I must be a bit slow, but VBA really overwhelm me), but
after years of loading, lisp routines in MNU files with the faithful
^C^C(if (not cl) (load "cl"));cl , ,
and using the same method, but with ARXLOAD, with ARX files, I am not yet sure
how to load DVB
files in MNU files (I owe to you to know that these files are VBA applications);
One last note, Take a look at what Ralph worked up prior to building the project!!
For the form:
1 tab strip named tabImages
9 image controls (all with default names) placed in the client area of the tab strip
1 command button (default name)
1 text box (default name)
The following day, despite the sadness that weighed heavily on his heart due to
the unfortunate death of the armless campanologist, the bishop continued his
interviews for the bellringer of Notre Dame. The first man to approach him said,
"Your excellency, I am the brother of the poor armless wretch that fell to his
death from this very belfry yesterday. I pray that you honor his life by allowing
me to replace him in this duty."
The bishop agrees to give the man an audition, and as the armless man's brother
stoops to pick up a mallet to strike the first bell, he groans, clutches at his chest
and dies on the spot. Two monks, hearing the bishop's cries of grief at this
second tragedy, rush up the stairs to his side.
"What has happened?", the first breathlessly asks, "Who is this man?"
"I don't know his name," sighs the distraught bishop, "but he's a dead ringer for
his brother."
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
2. In this very same project we are looking at having about 400 layout
tabs. To find a specific layout can be quite cumbersome. Is there no
way of going directly to the tab you want. Each layout tab has been
named the same as the drawing number ie "PE 123".
Cheers
Dave
-------------------------
The polyline query is really quite simple. Just stick it in a while loop.
;CODING STARTS HERE
(defun c:pclose ( / pt1 pt2)
(setq pt1 (getpoint "\nFirst point: "))
(setq pt2 (getpoint pt1 "\nSecond point: "))
(command "PLINE" pt1 pt2)
(while (setq pt2 (getpoint "\nTo point: " pt2))
(command pt2)
);end while
(command "c")
(princ)
)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
http://www.afralisp.com/lisp/attab.htm
http://www.afralisp.com/vl/attab-vl.htm
http://www.afralisp.com/vba/attabvba-htm
You've got the choice between straight AutoLisp, Visual Lisp or VBA. All three do exactly
the same but using slightly different methods. The main point though, is that they all
retrieve the block containing attributes by name and then manipulate the attribute entities.
--------------------------
Hi Kenny,
A question subjected to Autolisp would like to ask you. If there are a list of number, how
to convert the information to a polygon via autolisp?
Example :
34,324 54,3242 234,234 534,45 234,234 ......
which is equivalent to :
x1,y1 x2,y2 x3,y3 x4,y4 ....xn,yn
where the x,y represent the vertex of polygon, and x1,y1 will connected to xn,yn
As well, do you know is there any autolisp program to convert Caltech Intermediate
Format (CIF) to AutoCAD (DWG / DXF ) format?
Regards
Victor Li
--------------------------
The Answers
--------------------------
Kenny,
Just been checking your web page out. I'd been looking for some hints and tips on VBA
and came across Afralisp. Nice site.
I'm the cad manager for a building services consultant in Sydney. We run a mixture of
Autocad 2000i and the 2000 LT version. I used to use a lot of lisp at the last company I
worked - they ran the full version on all cad terminals, so it gave me a lot of control.
However, having a mixture of the full and the LT at this place means that everything has to
be set up for the 'lowest common denominator'. That is, all my routines have to be
accessible to LT. I've had to spend a hell of a lot of time setting up menus using simple
macros with some diesel thrown in. Even had to buy a bar fridge so that I could work
uninterupted in my computer shack.
I would imagine that this problem is widespread, as the price difference between the 2
versions is significant and I cannot, in all honesty, justify any increase in productivity by
asking the management to spend a few thousand dollars per platform to upgrade to the
full version.
I still use a lot of lisp myself, but there are things that I want to do for all cad draughtsmen
that become impractical when not everyone has access to that particular routine. For
Yours,
Ian Matthews
----------------------
ddlayout : dialog {
label="**Layouts**";
:list_box { key = "layouts";
height = 30;
width = 25;
allow_accept = true;
}
ok_only;
}
Working my way through a large pile of your newsletters...came across question re best
way to rotate crosshairs to certain angle. Kev Knowles sent a page or 2 of yummy looking
lisp which I'm sure does the trick.
Am I missing something, or would this mini macro be a bit simpler to use. We use it as a
button on our standard toolbar.
'SNAP R 0,0;PER;
Click the button, click the entity (polyline, xref, you name it) and voila. We've got another
button to snapang to zero when you're done. Works for me...
Thanks,
Ian M
---------------------------
Here is another version of pclose with the ability to enter "c" or "space"/"enter" for the
prompt. Also it cleans up the prompts on the command line.
Mike Melichar
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Hello,
Thanks for your newsletter. I have a question to submit:
I have a Microsoft Access database in MA2001. I'm using Autocad 14. My database is
about 12 fields long. I have about 120 records in this database and would like to link this
database to drawings.
I work for an electrical contractor and the drawings are in paperspace with an mview
window. The Access table is a list of conduit runs, the fields describe the properties of
the run (size conduit, contents, source, destination, bla, bla, bla. There is also a ref #). If,
for example (5) conduits appear in a particular drawing, I'd like those (5) records to be
linked into the drawing, when I specify the appropriate ref # somewhere. The information
could be displayed on the paper space next to the mv window or in another mv window.
Can this be done? If so could we go a step further and say that some sort of intelligence
could be added to objects to make the proper records appear in each drawing
automatically?
Thank You,
Darryl
-------------------------------
Dear sir,
I am facing the following problem: I would like to move a block in Acad, thusfar no
problems, if I do this with the "move" command, then a ghost image appears after
selecting the `base point`, so that one can see where the object will be positioned after
clicking the target-point.
Now the following question: is this possible through VBA??? Moving objects and
regards
Mark Bowes
--------------------------
The Answers
--------------------------
Here's a lisp routine for exploding minserted blocks into single blocks and keeping the
minsert block pattern?
Heine Munch Nielsen
----------------------
To unsubscribe from the AfraLisp Newsletter, clink on this link :
http://www.yourmailinglistprovider.com/[email protected]
We will then hunt you down and make you change your mind.
-----------------------
This newsletter is hosted by :
http://www.yourmailinglistprovider.com
-----------------------
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------------
Quote of the week
--------------------------------
"I am amazed at radio DJ's today.
I am firmly convinced that AM stands for Absolute Moron.
I will not begin to tell you what FM stands for."
- Jasper Carrott
--------------------------------
The Site
--------------------------------
Have you upgraded to 2002?
Have you lost your "Express Tools?"
Would you like to have Express Tools installed in 2002?
You would? OK, now follow these simple steps :
Firstly, you will need to have your R2000 installation disk.
Got it? Great!
Create a sub-directory "Express" under the main AutoCAD 2002 directory.
Copy all the files in the AutoCAD 2000\Express directory to your new "Express"
sub-directory.
(Copy Autocad 2000\express\*.* to Autocad 2002/express)
Copy Autocad 2000\support\acettest.fas to Autocad 2002\support
Copy Autocad 2000\help\acetmain.hlp to Autocad 2002\help
Copy Autocad 2000\help\acetmain.cnt to Autocad 2002\help
Please note that I haven't tested whether on not all the Express Tools work correctly in
AutoCAD 2002.
-------------------------------
Don't you like the "Double-Click" feature in 2002?
Would you like to switch it off?
You can disable the double click by typing "Dblclkedit" at the command line and selecting
"Off".
Just thought you might like to know!
-------------------------------
Would you like to use AutoCAD commands from Visual Basic or VBA?
Use the SendCommand method on the document object.
This example sends a command to the AutoCAD command line of a particular drawing for
evaluation. We will create a Circle in the active drawing and will zoom to display the entire
circle
'CODING STARTS HERE
Sub Example_SendCommand()
ThisDrawing.SendCommand "_Circle" & vbCr & "2,2,0" & vbCr & "4" & vbCr
ThisDrawing.SendCommand "_zoom" & vbCr & "a" & vbCr
ThisDrawing.Regen acAllViewports
MsgBox "A circle command has been sent to the command line of the current drawing."
End Sub
'CODING ENDS HERE
----------------------------------------
Do you know that you can automate the creation of DWF files using VBA?
The following code listing provides an example of how to create a DWF file using VBA :
'CODING STARTS HERE
Sub test()
);defun
(princ)
;CODING ENDS HERE
-----------------------------------
Good Morning Mr Ramage,
My name is Chris Griffiths, i spent a night searching the internet for an Autocad program
that would extract 'attext' data from clients drawing title blocks. Preferably a stand alone
program. I found 2, one costs too much for the single need I have, the other program is
'attext.exe' which is very simple but I believe, it needs the dwgs to be in release 12, so I
need to batch convert a few hundred dwgs.
Does your program do this, and how does it work? I tried to use your prog but did not
know where to run it from. Sorry I am a bit incompetent when it comes to technical things.
Chris Griffiths
-----------------------------
My problem is with the creation of the slides. I am having problems with the slides not
filling the image tile fully. They appear as fairly small images in the image tile. I would also
like to be creating them so they are fairly consistant in location.
What's happening...
The dialogue shows a duct piece, when various insulation radio buttons are selected, the
image tile changes to reflect the set insulation. The original slides I created are perfect but
I have created more with extra detail and these are all over the place - I just can't
remember the trick.
Mark
--------------------------------
Could you give me some feedback about the 3d packages you looked at? I’m specifically
interested in applications for architects in conjunction with Autocad.
Regards Charles Howroyd
------------------------------------
Charles,
I looked at four main packages. Unfortunately, I was looking at them from the point of view
of Plant Layout and Structural/Mechanical design/detailing and not from an Architectural
point of view.
I had a look at Rhino, AutoCAD Inventor, Rebis and Pro-Engineer.
--------------------------------------
Kenny
Do you or any of your readers have a routine that will search a drawing for 2 identical
entities, be it blocks, lines text etc and delete all but one of those entities.
I have recieved a number of external drawings lately, that have 2 lots of blocks, 1 on top of
the other and am looking for a quick way of cleaning them up. Any help would be greatly
Now they're down to the woman left to test. Again they lead her to the same door to the
same room and hand her the same gun. "We must be sure that you will follow instructions
no matter what the
circumstances, this is your final test. Inside you will find your husband sitting in a chair.
Take this gun and kill him." The woman took the gun and opened the door. Before the
door even closed all the way, the CIA heard the gun start firing. One shot after another for
13 shots. Then all hell broke loose in the room. They heard screaming, crashing, banging
on the walls. This went on for several minutes, then all went quiet. The door opened
slowly, and there stood the woman.
She wiped the sweat from her brow and said "You guys didn't tell me the gun was loaded
with blanks!
I had to beat the son of a bitch to death with the chair!"
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
_$ (vl-filename-directory "c:\\lisp\\lispfile.lsp")
"C:\\LISP"
And a couple more just for interest sake :
VL-FILENAME-BASE
Returns the name of a file, after stripping out the directory path and extension.
(vl-filename-base filename)
Arguments : filename
A string containing a file name. The vl-filename-base function does not check to see if
the file exists.
Return Values :
A string containing filename in uppercase, with any directory and extension stripped
from the name.
Examples
_$ (vl-filename-base "c:\\acadwin\\acad.exe")
"ACAD"
_$ (vl-filename-base "c:\\acadwin")
"ACADWIN"
VL-FILENAME-EXTENSION
Returns the extension from a file name, after stripping out the rest of the name.
(vl-filename-extension filename)
Arguments : filename
A string containing a file name, including the extension. The vl-filename-extension
function does not check to see if the specified file exists.
Return Values :
A string containing the extension of filename. The returned string starts with a period (.)
and is in uppercase. If filename does not contain an extension, vl-filename-extension
returns nil.
Examples
_$ (vl-filename-extension "c:\\acadwin\\acad.exe")
".EXE"
_$ (vl-filename-extension "c:\\acadwin\\acad")
nil
--------------------------------------
Howdy Kenny et all,
I dont know much about the 'Registry' and I noticed that you had a lisp in this weeks
newsletter regarding accessing it and etc. My question is simply: "What exactly is the
Registry and where do I find it?" Any info at all concerning this area would be
appreciated as I am not familiar with it in any way at all. I realise its probably more a
general computer question than an Autocad question but I'd really like to know anyway.
A lighter note :
What do you call a skeleton in the closet with blonde hair??
Last years Hide n' Seek winner. heh heh..!
Til next time its fare thee well from Oz.....
Pete
---------
Pete,
The registry is used by applications and Windows to store configuration data. It is a
replacement for the large numbers of .ini files that proliferate on Windows 3.x machines,
and is also used heavily by OLE.
Windows 3.1 used initialization (INI) files to store system-specific or application-specific
information on the state or configuration of the system. For example, the WIN.INI file
stored information about the appearance of the Windows environment, the SYSTEM.INI
file stored system-specific information on the hardware and device driver configuration
of the system, and various INI files (such as MSMAIL.INI and WINWORD6.INI) stored
application-specific information.
The Registry remedies this situation by providing a single location for a computer's
configuration information.
The registry is organized using a hierarchical series of keys and values resembling a
tree. Each key, beginning with one of the six predefined root keys, can have subkeys and
values associated with it.
You can access the Registry by choosing "Start" then "Run".
Enter "REGEDIT" into the "Open" text box and then select "OK".
Now open the "HKEY_CURRENT_USER" folder (root key).
Next open the "Software" folder (subkey).
You should find a folder entitled "Autodesk".
Keep on drilling down. You will find a treasure trove.
This will be one subject that I will be looking at in more detail in "Out of the Nutshell".
****WARNING***
Editing the Registry incorrectly can cause serious problems that may require you to
reinstall your operating system. BEFORE you attempt to edit the registry, make sure you
understand how to restore it if a problem occurs. You have been warned!!!!
--------------------------
Hello Kenny, long time no write. I have noticed that your newsletter is back and running
after along period of "no-letter". Oh well.
I have a question that will make you think a wee bit. You can call it a 3 beer question.
That is you can take up to 3 beers to find an answer. If by then you don't know the
answer, then you can have another 3.
Ok, here goes. I wrote a lisp that analyzes drawing files. You run the lisp and at the end it
tells you how many layers and names in a drawing. How many entities in each layer. How
many block names and instances of each.
In summary, it gives all relevant information of what is in the drawing.
Now what it is missing is SHAPES. And the question is: how do you query for shapes. Is
there a SHAPE table, like BLOCKS and LAYERS?
Thanks Kenny.
Ramón Castro
-------------------------
I have noticed that when you open a drawing that was saved in R14 that you get a
message stating that you are opening an early release saved drawing. you also get the
message when you do your work in LD3 and then save it to R14 format. I have found that
be typing in "EXPERT" at the command line you can this from happening. The only
problem is that when you exit out and then restart AutoCAD that it defaults back to "0".
Does any one know of a way to changes this so that the dialoge box come up?? Please
let me know. We have to
save it in R14, because we still have some Architects in my firm using R14, and they do
not want to change.
Thanks
Brian
--------------------------
The Answers
--------------------------
One of your readers asked about a attribute extract program
Here is one for you.
Have a great day
Peter Jamtgaard
----------------------------
;CODING STARTS HERE
(defun C:Get_Attributes (/ ATTLIST ELST ENT ETYP )
(setq ENT (car (entsel "\nSelect block: "))
ELST (entget ENT)
ETYP (cdr (assoc 0 ELST))
)
(if (= ETYP "INSERT")
(if (assoc 66 ELST)
(princ (setq ATTLIST (atts_to_list ENT)))
(princ "\nThat block doesn't have attributes: ")
)
(princ "\nThat is not a block! ")
)
(prin1)
)
(defun ATTS_TO_LIST (ENAM)
(setq X (vlax-ename->vla-object ENAM))
(if (= (cdr (assoc 66 (entget ENAM))) 1)
(progn
(mapcar '(lambda (X) (cons (vla-get-tagstring X)
(vla-get-textstring X)
)
)
(vlax-safearray->list
(variant-value
(vla-getattributes
(vlax-ename->vla-object ENAM)
)
)
)
)
)
)
)
;CODING ENDS HERE
-----------------------------------
Hi Kenny
Re: My problem is with the creation of the slides.
The following info on slide creation is from the AutoCAD 2002 Online Help File -
You can use any slide generated by AutoCAD as an image. However, the optimal use of
Image tile menus requires that you take care in preparing slides that will serve as
images.
Follow these guidelines :
Keep it simple. When an Image tile menu is displayed, the user must wait for all images
to be drawn before making a selection. If you are using the Image tile menu to show the
user numerous complex symbols, make the images simple versions of the symbols
rather than full renditions. An image should be as simple as possible and yet
immediately recognizable. Fill the box. Screen space is limited, and images appear in
small portions of the full screen. When making a slide for an image, be sure to fill the
screen with the image before entering the MSLIDE command. If the image is very wide
and short, or long and thin, the Image tile menu will look best if you center the image on
the screen with the PAN command before making the slide.
Images are displayed with an aspect ratio of 3:2 (3 units wide by 2 units high). If your
drawing area has a different aspect ratio, it can be difficult to produce image slides that
are centered in the Image tile menu. If you work within a floating viewport that has an
aspect ratio of 3:2, you can position the image and be assured that it will look the same
when it is displayed in the Image tile menu.
Hello,
This morning while getting ready for the day, I realized the solution for problems some of
your readers are facing in their programming department.
They don't really want an Applications Programmer; They want an increase in sales,
reduction in implementation time as well as a reduction in customer complaints about
their product.
Now, I am not some "Developer Cowboy" with an itchy trigger finger. I have
"sleeves-rolled-up" programming skills that will help your readers in their pursuit to:
1. Increase their customer satisfaction.
2. Improve customer service relations.
3. Reduce implementation time and costs.
4. Reduce redundancies that lead to "spaghetti" code.
More importantly, I understand that they are in business to MAKE MONEY and I will help
them do that as well as help get more customers, sell them more and bring them back for
more.
I have worked with some very switched on operators and have copied and emulated
many of the ideas and strategies they use to run successful, service oriented, profit
driven software companies.
I realize that a good applications developer does more than write code to accomplish a
SPECIAL SKILLS
Proficient in Visual basic, JavaScript· Proficient in MS Access, pervasive.SQL, MSSQL
and Paradox databases.
I know my way around ADO.
Experienced in PASCAL, FORTRAN, DELPHI, R-Base, DBII, Basic, Dreamweaver4 and
FORTH.
Experienced in all phases of production, including design, customer service, product
testing and evaluation.
Excellent Database normalization skills.
Excellent ladder logic and PLC programming skills.
Contact Details :
Larry Hooven
P.O. BOX 94,
NORCO, CA 92860
PHONE 909-734-0609
mailto:[email protected]
---------------------------
The Back Stoep
---------------------------
For years, it has been believed that electric bulbs emit light, but recent investigation has
proven otherwise. Electric bulbs don't emit light; they suck dark. Thus, we call these
bulbs Dark Suckers.
Studying the Dark Sucker Theory and the characteristics of dark suckers has proven that
----------------------
To unsubscribe from the AfraLisp Newsletter, clink on this link :
http://www.yourmailinglistprovider.com/[email protected]
We will then hunt you down and make you change your mind.
-----------------------
This newsletter is hosted by :
http://www.yourmailinglistprovider.com
-----------------------
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Cheers,
Kenny Ramage Q.B.E.
=====================================
AfraLisp : http://afralisp.hypermart.net
=====================================
To unsubscribe send e-mail to
mailto:[email protected]
with "Unsubscribe" in the Subject Line.
We will then hunt you down and make you
change your mind.
=====================================
To subscribe to AfraLisp send e-mail to
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
;;;(defun-q MYSTARTUP ( )
;first set the flag
(setq flag1 T)
;check for the existence of the menu
(setq loaded (menugroup "MYMENU"))
;if it's not loaded
(if (= loaded nil)
;do the following
(progn
;find the menu
(setq temp (findfile "MYMENU.MNU"))
;if you find it
(if temp
;do the following
(progn
;suppress dialogues
(setvar "FILEDIA" 0)
;load the menu
(command "menuload" "MYMENU")
;un-suppress dialogues
(setvar "FILEDIA" 1)
;load the first pulldown
(menucmd "P11=+MYMENU.POP1")
;load the second
(menucmd "P12=+MYMENU.POP2")
;tell them what you are doing
(prompt "\nLoading MyMenu Custom Utilities....\n")
);progn
;if you cannot find the menu, do this
(progn
;tell the it's missing
(alert "Cannot Locate MyMenu Menu. \n
Blame Randall Raath.")
;clear the flag
(setq flag1 nil)
);progn
);if
);progn
);if
;if the flag is set
(if flag1
;inform the user
(prompt "\nMyMenu Custom Utilities Loaded....\n")
Cheers,
Kenny Ramage Q.B.E.
=====================================
AfraLisp : http://afralisp.hypermart.net
=====================================
To unsubscribe send e-mail to
mailto:[email protected]
with "Unsubscribe" in the Subject Line.
We will then hunt you down and make you
change your mind.
=====================================
To subscribe to AfraLisp send e-mail to
mailto:[email protected]
with "Subscribe" in the Subject Line.
=====================================
If you enjoy good music, visit :
"BedRock - The Band in the Sand"
http://kramage.tripod.com
=====================================
All reasonable precautions have been taken to ensure no
viruses are present in this e-mail. AfraLisp cannot
accept responsibility for loss or damage arising from
the use of this e-mail or in fact, anything that goes
wrong with your P.C.
==========================================
Bye.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Cheers,
Kenny Ramage Q.B.E.
======================================================
Sites worth a wee look at :
VB Design
http://www.vbdesign.net/
Contract CADD Group
http://www.contractcaddgroup.com
AcadX.Com
http://www.acadx.com
Reini Urban
http://xarch.tu-graz.at/autocad
=====================================
AfraLisp : http://www.afralisp.com
=====================================
To unsubscribe send e-mail to
mailto:[email protected]
with "Unsubscribe" in the Subject Line.
We will then hunt you down and make you
change your mind.
=====================================
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
==========================================================
The Back Stoep
I mentioned my daughter Kyla finishing her preliminary exams last week. Well, she brought home
one of her exam papers. I knew things had changed since I was at school, but this was what was
written at the top of the exam paper :
Note :
Please read all instructions carefully.
If the words are too long, ask the examiner to read them for you.
Write all answers between the lines.
No part of the answer book is to be rolled and smoked.
No children of students are allowed to participate.
Leave firearms in the possession of the parole officer.
Bribes may be accepted for amounts exceeding $500.
If this exam paper does not match the one purchased last night
please notify the examiner.
Cheers,
Kenny Ramage Q.B.E.
======================================================
AfraLisp : http://www.afralisp.com
=====================================
To unsubscribe send e-mail to
mailto:[email protected]
with "Unsubscribe" in the Subject Line.
We will then hunt you down and make you
change your mind.
=====================================
To subscribe to AfraLisp send e-mail to
mailto:[email protected]
with "Subscribe" in the Subject Line.
=====================================
If you enjoy good music, visit :
"BedRock - The Band in the Sand"
http://kramage.tripod.com
=====================================
All reasonable precautions have been taken to ensure no
viruses are present in this e-mail. AfraLisp cannot
accept responsibility for loss or damage arising from
the use of this e-mail or in fact, anything that goes
wrong with your P.C.
==========================================
Bye.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Dave,
I'll try and find some time and add the crane sections to Ddsteel.
In fact it's due for a spring clean and polish.
=========================================================================
Hello there Kenny,
I am simple AutoLisper per say and have a major hang up at the moment.
I have a list [ex. (1.0 5.0 6.0 8.0 2.0) ] and need them in a new list, in proper order [ex. (1.0
2.0 3.0 4.0 ect....)]. Can you possibly help here?
Thanks,
Eric
mailto:[email protected]
Eric,
Try this :
;create a list
Command: (setq a '(1.5 5.7 9.3 2.4 1.1))
Returns: (1.5 5.7 9.3 2.4 1.1)
;convert to strings
Command: (setq a (mapcar 'rtos a))
Returns: ("1.5" "5.7" "9.3" "2.4" "1.1")
;sort the list
Command: (setq a (acad_strlsort a))
Returns: ("1.1" "1.5" "2.4" "5.7" "9.3")
;convert back to real numbers
Command: (setq a (mapcar 'atof a))
Returns: (1.1 1.5 2.4 5.7 9.3)
If you are using Visual Lisp it's worth looking at the
vl-sort functions.
For more complex sorts, check out Tony Tanzillo's sort page at :
http://ourworld.compuserve.com/homepages/tonyt/sortsort.htm
or Reini Urban at :
http://xarch.tu-graz.ac.at/autocad/lisp/#sort
===============================================================
Ken,
I'm looking for a way to add a support path to autocad using autolisp. Can you please
help?
Dave
mailto:[email protected]
Dave,
Try this out :
;<-Coding Starts Here
(defun addSP (dir pos / tmp c lst)
(setq tmp ""
c -1
)
(if
(not
(member (strcase dir)
(setq lst (mapcar 'strcase (parse (getenv "ACAD") ";")))
)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Thanks
Rod
mailto:[email protected]
===============================================================================
Hi,
My name is Andrea and your website is a big reference for me.
I would like to know how to extract an attribute in a variable:
example: (setq att1 ( get the attribute whos the tag is "x"))
I don't know how. Could you help me with this ?
thank you
mailto:[email protected]
Hi
My Name Is Jeff.
I realy appreciate the web site, it is very helpful.
I was wandering if you could shed some light on a
problem I'm having?
I can not figure out how to get text entered in an
edit box to run in a lisp routine.
I wrote a simple lisp routine to change the text in
a block attribute.
Kind of like changing xx to JBP in the title block
where it says drawn by.
I can not get it to work with a dialog box.
Your help would be greatly appricaited.
Jeff Pickett
mailto:[email protected]
Andrea/Jeff,
You'll find the answer to this one at :
http://www.afralisp/lisp/attab.htm
It's a wee bit large to include in this forum.
==========================================================
Answers
The question was:
"Anybody know the latest method of loading and
unloading a VBA application using AutoLisp?"
Here's another method:
(vl-vbarun "MyFile.dvb!MyMacro")
I think this is the easiest method, and I still don't understand why you need to unload :-)
For Nestor AS
Ragnar Thor Mikkelsen
mailto:[email protected]
The front runner to this discussion (I was going to say argument but people might get upset,)
is without doubt "VL-VBALOAD."
Why????
If you use the command "VBALOAD" and the VBA application is already loaded, you get
an error message. "VL-VBALOAD" does not cause an error and just does nothing if the
application
is already loaded. (or maybe it loads it again and makes it run twice as fast???)
Why would you want to unload?
In the "olden" days, system resources were valuable and if you were not using an application,
you would unload it to conserve memory.
Just habit I guess. Jeepers, you youngsters are spoilt!!!
===============================================================
The Back Stoep
I was thinking about what I mentioned just now about preserving system resources. I started
using AutoCAD with Release 1.7. It came on ONE 320kB floppy disk. (I've still got it.) We had no
hardrives. First we loaded DOS (remember that dark place,) with one disk, then we loaded
AutoCAD, and then we stuck another disk in to save our drawings. One day, my boss arrived in
the office with a "borrowed" PC that had a 10 meg hardrive installed. "There is no way on earth
that we could possibly fill this." I confidently remarked. We used to store all the drawings in one
big directory. No clue that such a thing as sub-directories existed. No mouse, no digitizer, just
the pen and, wait for it, a black and white monitor. (10") No pull down menu's, no toolbars, no
icon menu's, just the screen menu. I felt like a king on the cutting edge of technology. We used
to customise the AutoCAD menu using "Word Star." You needed a degree in computer science
just to understand the keystroke combinations on that word processor!!!
O.K. I'm showing my age. Hey, this was only 18-19 years ago.
Must go, it's time for my tablets and my daily walk around the garden with the nurse.
Talk again soon...........
"Apparently, 1 in 5 people in the world are Chinese.
And there are 5 people in my family, so it must be one of them.
It's either my mum or my dad, or my older brother Colin.
Or my younger brother Ho-Cha-Chu.
But I think it's Colin."
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Two new functions, acad-push-dbmod and acad-pop-dbmod, can be used to suspend and resume the
$DBMOD recording mechanism that AutoCAD uses to track changes to a drawing. These functions allow
applications to make changes to a document as part of their initialization process without setting flags in
$DBMOD and triggering unwanted save drawing queries.
(acad-push-dbmod) pushes the current value of the $DBMOD system variable for the document onto an
internal stack. The function always returns T. (acad-pop-dbmod) restores the value of $DBMOD to the
most recently pushed value on the document's internal stack. The function returns T for a successful
stack pop and nil if the stack is empty.
The acad-push-dbmod and acad-pop-dbmod functions are implemented in acadapp.arx, which is loaded
by default on AutoCAD startup, but can be disabled, if desired.
To use the new functions, precede program actions that should not affect the value of "$DBMOD" with
calls to push the $DBMOD value, then pop the value after performing the action. Here is a simple LISP
example:
(acad-push-dbmod)
(setq new_line '((0 . "LINE") (100 . "AcDbEntity") (8 . "0")
(100 . "AcDbLine") (10 1.0 2.0 0.0) (11 2.0 1.0 0.0)
(210 0.0 0.0 1.0)))
(entmake new_line) ; Sets $DBMOD 1 flag
(command "_color" "2") ; Sets $DBMOD 4 flag
(command "_-vports" "_SI") ; Sets $DBMOD 8 flag
(command "_vpoint" "0,0,1") ; Sets $DBMMOD 16 flag
(acad-pop-dbmod) ; $DBMOD will again have the same value it had before
==================================================================
The Questions
Thanks for the help on my little dcl/lisp program!! It work fine.
I have been cruising thru your sit and reading all of your tutorials on lisp and VBA and I find them very
useful. My next step is to upgrade our panel schedule program to allow more functionality. We are
currently creating all of our schedules (HVAC, Electrical, Plumbing etc.) in excel and exporting to
AutoCAD using the Spanner program. It is an easy way to get your schedules into AutoCAD, but that is
about it.
I would like to be able to access these items from within Cad or from excel to do editing. I thought of
using OLE objects, but then I run into problems with them not wanting to print out right. I guess my
question to you would be, Do you have any information on using VBA with excel to import excel files into
AutoCAD, and be able to edit from either direction? Also how about converting an excel spreadsheet to a
VBA application? I made a small excel spreadsheet to do motor load calculations and I would like to try
and convert this to VBA. Can you direct me to more info on this subject?
Thanks for your knowledge!
David W Fitzgerald
mailto:[email protected]
===============================================================
Hi Kenny
I downloaded the vbasteel program together with all that I could find on vba programming and got stuck
into it, I was very impressed with the website as a whole.
Anyway I have filled the vbasteel program with all the BHP Australia sections including welded and pile
sections, if you think it will be any use on the website I will upload it to you,
it has ended up at 885 Mb so it's fairly hefty.
Regards
Cyril Horsey
South Australia
mailto:[email protected]
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Hi Kenny,
This is the first time that I write to you.
I just wanted to say that arc sine does not equal to 1/sin . AutoLISP has
arc tan function that returns the angle in radians knowing the tangent of
the angle.
The following equetions can be useful :
sin a * sin a + cos a * cos b = 1
tan a = sin a / cos a
this means you can calculate tan of the angle if you have the sin or the
cos.
the arc tan function in AutoLISP is (atan ). It takes one or two arguments.
You can take a look at this function in the LISP help .
Have a nice week-end
Sherko
Amsterdam, The Netherlands
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Kenny's Mum
P.S. I've got nice recipe for tripe and onion's if anybody is interested.......
============================================================================
Thanks Mum, now can I write something? Ouch!! All right, I'm sorry........
Due to popular demand, and threats of physical violence to my body from certain people who
shall remain nameless, I've decided to extend the Logo Competition for another two weeks.
Every logo I receive will be posted on AfraLisp at http://www.afralisp.com/logo/logo.htm. So
pop along and have a look. Thanks to all who voted already but I'm going to have to ask you
to do it all over again in a couple of weeks.
Please do not send in your votes yet. I will let you know when the last logo has been posted
and voting can commence.
If you want to quickly find out "Whats New" on AfraLisp, pop along to :
http://www.afralisp.com/whatsnew.htm for all the latest site updates.
*****AND*****
Special Courses for our female subscribers. Check out the Back Stoep......
Have you ever wanted to design your own bicycle? Then pop along to
http://www.afralisp.com/olisp.htm and download "Bike-Lisp". Clever little application and
good fun. Thanks Alan.
I'm looking for some ideas for tutorials using AfraLisp. Any ideas? Should I start looking at
Visual Lisp? Should I concentrate more on VBA? Or, should I carry on "as is" and just keep
on giving a mixture of everything? Should I start giving guitar lessons?
Feedback pleeeeease!!!!! Or, as the Froggies say "R.S.V.P."
How does a repository of "Classic" AutoLisp routines sound? You know the type I mean. The
one's that you know are out there, you've seen them a thousand times, but you can't find
when you need them. Let me know and I can start putting a collection together.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
==================================================================
The Answers
Kenny,
Keep up the great work. I like the option of "carry on as is" with a
little more emphasis on visual lisp. The repository of classic lisp's
would be wonderful if you could categorize them somehow.
Sincerely,
Jim Basnett
Jim,
Visual Lisp is on it's way.
I'm still looking into the feasibility of the "Classic" section, although I'm very tempted.
Watch This Space........ " "
================================================================
Dear Kenny's Mum,
Please do not send me the nice recipe for tripe and onion's.
Thanks,
Tony Burns
Tony, you don't know what you're missing. Taste buds maybe. :-)))
================================================================
Do you know..........?
AutoLISP supports concatenations of car and cdr up to four levels deep. The
following are valid functions:
caaaar cadaar cdaaar cddaar
caaadr cadadr cdaadr cddadr
caaar cadar cdaar cddar
caadar caddar cdadar cdddar
caaddr cadddr cdaddr cddddr
caadr caddr cdadr cdddr
caar cadr cdar cddr
Can you imagine trying to pronounce cddddr!!
You'd sound like a machine gun.
===========================================================
A couple of interesting sites I popped into during my travels:
@Acad+
http://www.newz.net/acadplus/homeangl.htm
The "Mech" of Cad
http://www.microtec.net/mrochon/
And here's a site from some guy who seems to be a bit of a rookie at VBA.
Not bad though for a beginner. Check it out....
http://www.vbdesign.net
==================================================================
Remember, the "AfraLisp Logo Competition" is still open. Send your Logo to :
mailto:[email protected] or pop along and have a look at all the entries at :
http://www.afralisp.com/logo/logo.htm
==================================================================
The Back Stoep
I've decided to give an early Xmas present to all AfraLisp Newsletter subscribers.
Other people give away screen savers, wallpaper or mouse pads. I though, have decided to
be different and give away a special "AfraLisp Coffee Holder". Just click on this link to
download; http://www.afralisp.com/zip1/coffee.zip or visit the download page at :
http://www.afralisp.com/vba.htm to grab online.
A couple of weeks ago I had a bit of a dig at the Yanks.
Now it's the English tribes turn :
31 English university graduates have died since 1996 by watering their Christmas tree while
the fairy lights were plugged in.
19 English people have died in the last 3 years believing that Christmas
decorations were chocolate.
English Hospitals reported 4 broken arms last year after cracker
pulling accidents.
101 English people since 1999 have had to have broken parts of plastic toys
pulled out of the soles of their feet.
18 Englanders had serious burns in 2000 trying on a new jumper with a lit
cigarette in their mouth.
A massive 543 English football supporters were admitted to A&E in the last two years after
opening bottles of beer with their teeth.
5 English schoolteachers were injured last year in accidents involving out of control
Scalextric cars.
and finally.........
In the year 2000, eight Scotsmen cracked their skull whilst throwing up into the
toilet!
Tara the noo,
Kenny Ramage Q.B.E.
===============================================================
AfraLisp : http://www.afralisp.com
===============================================================
Did you miss a newsletter?
Are you a new subscriber?
The "AfraLisp Newsletter Archive" can be found at :
http://www.afralisp.com/newsletter/newsletter.htm
===============================================================
To unsubscribe send e-mail to
mailto:[email protected]?subject=Unsubscribe
stating your reasons in not less than 1000 words.
We will then hunt you down and make you
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Bring to Front
^C^C^P(ai_draworder "_f") ^P
Send to Back
^C^C^P(ai_draworder "_b") ^P
==================================================================
Hi, I would like to replace this......
(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))
(if ss1
(progn....blah ...blah....
to only one selection....like
(setq ss1 (entsel))
but is not working..!!?? why....any one can help me ??
Andrea Andreetti
Andrea,
The first expression is selecting everything in the drawing and filtering the entities. The next
expression, (entsel) only allows you to select a single entitity. Why would you want to filter a
single entity?
Now I stand corrected. Andrea, please make your way along to this site :
http://www.acadx.com
Select "AutoLisp" from the side-bar menu and then "I:EntSelf". This is the description of the
routine. (I nearly "stole" it , but then thought, "Hey Kenny, they probably need the traffic on
their site.")
This routine is useful when you have congested drawings that (entsel) would normally have
fits with. The advantage in this case, is that this routine acts like an (entsel), but really uses
an (ssget) with a crossing box the size of your pickbox. This permits the use of selection set
filters, to give you control over what the user selects.
Author
R. Robert Bell
See, you live and learn.
======================================================
The Answers
The question was :
Is it possible to get a program to select a file just plotted and have it
sent to a backup folder ?
And the answer is :
Copy and paste this coding into Notepad and save it as "EndPlot.lsp". You must only load
this application. "Do not run it, as it contains reactors".
Open the drawing you want to plot, and then load the application : (load "endplot")
Plot your drawing. At the end of the plot the application will first Save the drawing to the
current directory, and then SaveAs, to a directory called "c:/backup/". You can quite easily
change the directory path to suit your backup directory.
;CODING STARTS HERE
(prompt " \nLoad Only....Do NOT Run...")
(vl-load-com)
;*******************************************************
(vlr-command-reactor
nil '((:vlr-commandEnded . endPlot)))
;*******************************************************
(defun endPlot (calling-reactor endcommandInfo /
thecommandend drgName newname)
(setq thecommandend (nth 0 endcommandInfo))
(if (= thecommandend "PLOT")
(progn
(setq acadDocument (vla-get-activedocument
(vlax-get-acad-object)))
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------------------
The Front Stoep
--------------------------
"We have a winner!!!" (thunderous applause from the peanut gallery.)
Congratulations and a BIG well done goes to "Michael DeMott" whose
tremendous "AfraLisp" logo was voted the most likely to succeed by
you. Yes you! The winning logo was No 4 and received 54% of the
popular vote.
A big thank you to all the other contestants and to you, the readers, for
taking the time and effort to cast your votes. Michael's logo will now
become the official trademark of "AfraLisp" and will be proudly
displayed on the website. He will also be the lucky recipient of my band
"BedRock's" new CD Recovery.
http://www.bedrockband.com
;**************
Can you see the potental for this type of reactor? Double-click on a text
object,
and the text edit box opens. Double-click on a line and the properties
dialog opens.
Double-click on your liquor cabinet and the bar opens. Hey, the
possibilities are endless.
------------------------
The Questions
------------------------
I have over 1500+ document files (*.doc) that need to be renamed into
their original document numbers (this was due to WIN95 character
limitations
in file name size). I have a Excel spreadsheet that tracks the existing
file name and the original file name. Is it possible to write an Autolisp
routine that will read the Excel spreadsheet and automatically rename
the
document file into its original file name?
I hope you can help me.
Thanks.
Peter Rutkowski
Peter, I'll be discussing AutoCAD and Excel/Access in the next week or
so.
Don't move your eyes from this spot. (except to eat, of course).
----------------------------------
Is it possible to change the color of the line in "underlined text" created
with the %%u without changing the color of the text ?
Kevin
Kevin,
I don't know how to change the %%u, but this will do the same job.
Just change the layer/color to suit :
;;;CODING STARTS HERE
(defun C:ULINE ( / textent tb ll ur ul lrx1 y1 x2 y2 p1 p2)
Kenny,
I really like Logo #4 and my son Travis seems to think that #10 is the
best.
Keep up the good work and I appreciated the back stoep from this
week's newsletter. Also, as far as classes or seminars for men, I can
only think of one but it would greatly help when relating to others.
Ego management - A weekly class for every man
Elise Bauman
--------------------------
Hi Kenny,
In answer to Kevin's question re. rotating lines from a base other than
0, I
am enclosing a lisp routine that I have
used for several years to rotate the crosshairs to an angle other than 0,
and becomes the new 0 base until reset.
The easiest way to use this routine is simply execute the command, the
default choice is <P> for pick, enter to accept, and select the chosen
line
with the pick box. This then becomes the new X - 0 base line and you
can
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
--------------
The Site
--------------
Have you noticed that AfraLisp now proudly displays it's new logo?
Look's nice hey? Thanks again Michael. I also took the opportunity to
re-organise and clean the site up a wee bit. All the main sections stay
in place, but if you have been linking to one of the sub-sections, you
may find the link has changed. Sorry!!!
As I've been busy updating the site this week, I only found time to add
one new section to the Visual Lisp tutorials. This is a tutorial on
Collections and you can find it at :
http://www.afralisp.com/vl/collect1.htm
I've also revised the "Selecting Objects" tutorial to include a section on
"Selection Set Already Exists". You can find this at :
http://www.afralisp.com/vl/selsets.htm
Don't forget, that if you what to find out "What's New" on Afralisp, just
pop
along to this page : http://www.afralisp.com/whatsnew.htm
------------------------
The Questions
------------------------
Kenny,
I am a bit slow on learning visual lisp and reactors.
The concept of a program which enables you to double clicking on
text and bring up the text edit box, as mentioned in your last
Newsletter,
appeals to me as I am still running AutoCAD 2000 which does not
support this feature.
Would it be possible for you to share the required code with us?
Regards
Craig Green
Craig, watch this space. I'm working on it!! (time, time, time).
----------------------
How can I modify the getfield dialog box..??
Or how can I create one ??
Is there any dcl similar ??
This will dump all properties of all the Layer objects in your drawing to
the console screen.
You are not limited to Visual Lisp functions within a
"vlax-map-collection" call. You can also use your own user defined
function. Let's say for some reason we wanted to make a list of all
Layers in your drawing, switch all Layers On and change every Layer
in the drawing to Color "5". This is how you could do it :
(defun layerMap ()
(vl-load-com)
);defun
---------------------------
The Back Stoep
---------------------------
If the World was fair to Men...
1. Valentine's Day would be moved to February 29th, so it would only
occur on leap years.
2. On Mothers Day, you'd get the day off to go drinking.
3. St. Patrick's Day would be celebrated every month.
4. Instead of "beer-belly", you'd get "beer-biceps".
5. Tanks would be far easier to rent.
6. Every woman that worked would have to do so topless.
7. Birth control would come in ale or lager.
8. When the Police pull you over, every smart-alec answer you
responded with would actually reduce your fine. As in: Cop: "You know
how fast you were going?" You: "All I know is, I was spilling my beer
all over the place. " Cop: "Nice one, That's $20.00 off".
9. Every man would get four, real Get Out of Jail Free cards per year.
10. Telephones would cut off after 30 seconds of conversation.
11. Nodding and looking at your watch would be deemed as an
acceptable response to "I love you".
12. The funniest guy in the office would get to be CEO.
13. "Sorry, but I got wasted last night", would be an acceptable excuse
for absence and/or poor time keeping.
14. Lifeguards could remove people for violating "public ugliness"
laws.
6. That girl is wearing the same outfit as me. Cool, I'm going to go over
and talk to her.
7. I love hearing stories about your old girlfriends/sporting
triumphs/nights on the town with the guys/war stories/jokes etc, etc.
Tell me more.
8. I like using this new lawn mower so much more than the old one.
What a great Valentines Day present.
9. Let's just leave the toilet seat up at all times.
10. I'm so happy with my new hair do, I don't think I'll ever change it
again.
11. I love it when my pillow smells like your cigars and whiskey.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
***************************************
MERRY XMAS
***************************************
--------------------------------------------------
AfraLisp Newsletter No 2001-15
--------------------------------------------------
19th December 2001
--------------------------------------------------
http://www.afralisp.com
mailto:[email protected]
--------------------------------------------------
AfraLisp is supported by :
"Contract CADD Group"
http://www.contractcaddgroup.com
--------------------------------------------------
Have you visited this site yet?
http://www.cadchat.com
----------------------------------------------------------
--------------------------
The Front Stoep
--------------------------
As this the last AfraLisp Newsletter for 2001, I would like to wish you
and your family, a very Happy Christmas and a Prosperous New Year.
May the force be with you.
The Newsletter will return in the first week of January, so if you have
any question, or answers, please feel free to send them in. I will be
online throughout the festive season. (maybe not quite sober, but
online!!!)
--------------
The Site
--------------
Stig Madsen very kindly took my VBA Menu coding and translated it to
Visual Lisp.
http://www.afralisp.com/vl/vlmenu1.htm
Nicely written and well worth a look.
Why not have a wee look at Stig's site "InterVision" while you're here :
http://intervision.hjem.wanadoo.dk/
-----------------------------------------------------------
I've also added a tutorial on "Visual Lisp and Errors".
http://www.afralisp.com/vl/vlerror.htm
If you are contemplating coding in VL, you'll need this.
---------------------------------------------------------
Here's a handy little VBA function :
'CODING STARTS HERE
Public Sub ColorToEntity()
'This subroutine sets each entities color from ByLayer
'to the color of the layer it's on.
Dim objEntity As AcadEntity
Dim objMS As AcadModelSpace
Dim objPS As AcadPaperSpace
Dim objLayers As AcadLayers
Dim objLayer As AcadLayer
Dim strLayer As String
Set objMS = ThisDrawing.ModelSpace
Set objPS = ThisDrawing.PaperSpace
Set objLayers = ThisDrawing.Layers
'process ents in modelspace
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Hi Homo-sapiens,
I've started a new section on AfraLisp entitled
"Quick VBA Tip's". Here's a sample :
Highlight Text
When you display a form, it's nice to highlight the text in a particular
text box so that the user does not have to delete the existing text before
typing in his new text string. Here's the coding :
**************************************************************************
Private Sub UserForm_Initialize()
UserForm1.TextBox1.SetFocus
'set focus to the textbox
UserForm1.TextBox1.SelStart = 0
'start at the first character
UserForm1.TextBox1.SelLength = Len(UserForm1.TextBox1.Text)
'highlight the text string
End Sub
*********************************************************************
*******************************************************************
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
CommandButton1_Click
End Sub
*******************************************************************
Private Sub CommandButton1_Click()
'Your coding goes here..............
End Sub
********************************************************************
If you have anything you would like published on this page, just drop me a
line. Remember, (I also have the AutoLisp Tip's and Trick's Page.)
=================================================================
Received this from Peter Lanzone :
The way we have it set up for our engineering drawings is that engineering
thanks!
Peter Lanzone
mailto:[email protected]
=============================================================
As I had nothing to do that evening, I decided to knock together a little
application for Peter. It worked O.K. in testing but now Peter's busy trying
it out in the working environment. If you are interested in something like
this, keep your eye on AfraLisp or send me a note.
==============================================================
Here's a new AutoLisp site :
http://members.xoom.com/rakesh_rao/cadgis.htm
===============================================================
Hi Kenny,
knowing you for a specialist in AutoCAD-Programming, today I'd like to ask
for your advice.
Thanks in advance,
Kathrin
==============================================================
Here's my reply to Kathrin :
Kathrin,
What to use VB or VBA? Let's look at VB first :
1) You can compile it into an EXE file which means the source code is
protected.
2) You can run multiple instances (within reason) of the application.
3) You have more comprehensive controls available but you will need to
distribute them to your users who will then have to install them.
1) You can give it a password which will give you the same level of
protection as an EXE file.
In your case, I would recommend VB since you will need to run multiple
instances. I have posted 2 stand-alone VB applications on AfraLisp that will
show you how to connect with AutoCAD. They will also show you how to run a
stand-alone application from within AutoCAD. Hope this helps....
=================================================================
Hi, saw your afralisp site. Nice work! Anyway, I have 9 copies of Autocad
12 for windows to sell for R8500 each, very much usable to upgrade to
Autocad 14 or 2000 at a saving of a couple of thousand Rands. Fully legal,
registered, with dongles, of course. Would you allow me to post a message
to this effect to your mailing list? Any ideas where I could advertise this
as well? I think Autodesk will allow upgrading only for the next couple of
months, and I want to avoid sitting with expensive software I cannot use.
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Hi Everyone,
Here's a letter that I've been expecting for some time :
Hi Kenny
It seems that since your VBA class that you have made AutoLisp your second
choice in programming AutoCAD. I mean, you haven't made any more tutorials
about AutoLisp or any new AutoLisp programs at your sight. If I'm wrong please
let met know.
You mentioned once that you have done all you can do with AutoLisp and are
now looking at VBA. Well, AutoLisp is not limited but the programmers
imagination can be, this is actually true about any programming language.
I don't want to be too critical, you have a great sight and are providing a
good public service. What I'm trying to say is I am interested in AutoLisp
programming not VBA or VB or ARX or ADS. If a person is serious about
programming for AutoCAD then AutoLisp and DCL is the way to go. The other
previously mentioned programming languages I consider either TOYS or just
bad approaches to customizing AutoCAD. Just don't forget about AutoLisp!
Joseph E. Willis
=========================================================================
When I wrote that I'd done about all I could do with AutoLisp, I was
refering to the Tutorial Section. (Although, I admit, I was wrong about
that).
Concerning the lack of new AutoLisp applications or Tutorials, I did post
three new tutorials last month and I have a whole new section on User Get
functions and User Input Validation which I hope to have posted within the
next week or so.
I don't agree with what Joseph is saying about AutoLisp being the only
programming language suitable for AutoCAD. Here's an article I wrote for
Randall Raaths "ACAD Code of the Day" concerning this issue :
I've lost count the number of times I've been asked that question. As far as
I'm concerned, it's not a difficult question to answer. Use both......
Each of them have got their strengths and weaknesses.
I mean, look at AutoCAD's DCL language. It's a positive pain in the
posterior designing dialogs in AutoCAD whereas with VB it's a pure pleasure.
And the AutoLisp coding for dealing with dialog's? Say no more. (If you
don't believe me have a look at the AutoLisp code required to hide a
dialog).
On the other side, look how simple it is to deal with blocks in AutoLisp. I
still haven't figured out how to explode a block in VB without resorting to
coding that sends commands to the command line. AutoLisp also deals with
lists in a much more friendlier manner than VB. (Well I think so, so there).
And having to declare all your variable types in VB really threw me at
first. I can now see the reasoning behind it and it does result in faster
more elegant application.
It's difficult to say when and where to use AutoLisp or VB. If you are
having to deal with the operating system or external files, then VB is
Thank you,
Garland Freeman Jr.
Drafting/Design
mailto:[email protected]
=======================================================================
Here's the coding I sent him :
(defun c:pend ()
(command "QSAVE")
(princ)
);defun
(princ)
=======================================================================
Pretty basic, but effective...........
I've had lot's of people e-mailing me with problems with their AutoLisp
routines. On inspecting the coding I almost always find a variable named the
same as an AutoLisp function. Do you know that naming a variable the same as
an AutoLisp function (or even an AutoCAD command name) is one of the most
common bug's. I've done it myself numerous times!!! You can also get a
similar type of bug if you don't declare your variables as local. The
program seems to run fine then all of a sudden it crashes. Nine times out of
ten, it's because you are picking up a value from an undeclared variable in
another function. So, if you have a problem with your AutoLisp routines,
check you variable names and Pleeeease, declare them.
==========================================================================
Now, somebody looking for some help :
Kenny,
I stumbled across your site whilst looking for some bits and pieces for my
Auto Cad Dwgs.
Now as I have never used Cad before I purchased R14 and here I am. Do you
know where I might be able to find some electrical symbols or even some
sites that have some shareware type of things.
If it sounds silly it is that I'm even new to this Internet thing as well.
Leigh Greig
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Hi All,
I've had a flood of new subscribers to this Newsletter over the past
week or two. Welcome and Enjoy and please feel free to E-Mail me with any
queries/ suggestions/money that you may have. Any complaints, please send
them to the following address : mailto:[email protected] :-))
==================================================================
I've added a few things to AfraLisp since the last time we spoke.
Hi,
Sincerely,
Wendy Clasen
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Crikey I'm early this week. It must be the weather!! (More likely whether or
not my brain is functioning). Or it could be because it's the first day of a
new month. Or even because it's the last year of this century? Or even
because my cricket team, South Africa, is through to the Super Six in the
cricket World Cup? (Which we are going to win, by the way). Anyway, enough
blathering and on with this weeks items.
First, I received 3 clever applications from Lintang Darudjati :
Hot Blocks v1.2
A block manager with an INI style customization file and a dialog box,
performing collection-grouping, file path display, and slide previews as
'hot thumbnails'. Build your own dwg block library with it, and make them
ready to be inserted easily, anytime.
Slide Factory v1.0
Automates the process of creating multiple slides and slide-libraries. It
creates slide files for all DWG files found in a user-selected folder. It
also creates a slide library file (SLB) if desired. Just select a folder
containing one or more DWG files, and the rest of process is in Slide
Factory's hands.
Layer Color Fixer v1.0
A small program for AutoCAD users. It fixes layer colors for plotting
purposes (via a dialog box) by assigning layer colors to an INI-style config
file that matches specific pen settings.
========================================================
You can download all 3 applications from the "Other AutoLisp" page :
http://members.tripod.com/~kramage/olisp.htm
or directly from Lintangs site at :
http://www.geocities.com/RainForest/1073/
mailto:[email protected]
===========================================================
I've also updated the "Acad Code a Day" page. Almost fully up to date, just
got one more week to add. Again, if you are into Visual Basic, Randall
Raaths newsletters have some invaluable information, so pop along and have a
look.
===========================================================
Here's a query I received from Mike Boerner :
Hi Ken..
I read your tutorial on DCL and found it very helpful. I was wondering if
you help me out, or point me in the right direction for the answer to my
next question; How do you enable/disable tiles by using toggles?
Y'know.. if you click on a toggle, it will turn on a previously greyed-out
area and allow the user to select choices from that area..
The ACAD manuals aren't that helpful. They discuss that you SHOULD use
them.. but don't tell you HOW to use them..
I appreciate your time..
Thanks..
Mike Boerner
Westcoast Energy Inc.
(604)691-5156
mailto:[email protected]
==========================================================
This was my reply to Mike :
Mike,
Let's hope this helps. Say for example you have a radio button with
(mode_tile \"eb1\" 0)
;enable edit box
(mode_tile \"myslider\" 0)
;enable slider
0 - Enable Tile
1 - Disable Tile
2 - Set focus to tile
3 - Select Edit Box Contents
4 - Flip Image Highlighting on or off
You can see this in action in a sample application that I wrote as part of
my tutorial "Dialogue Boxes Step by Step" You can find it at :
http://members.tripod.com/~kramage/lisp71.htm
==========================================================
Kenny
I need your help. I have written a routine that I want to operate on
multiple drawings. The sequence goes like this. I select a prototype plan
drawing by dialog box or input prompt. I saveas the drawing to a new name.
The routine then edits the drawing, then the routine saves the changes and
should load the next selected prototype drawing, however the routine stops
upon loading the next prototype drawing. I have the
system variable set to lispinit 0. The routine is in memory but does not
continue on the newly loaded drawing. I know that lisp memory is reloaded on
a per drawing basis if lispinit set to 1. It seems that the .open command
creates problems. Any help will be appreciated.
Andrew
==========================================================
If anyone can help Andrew, you can contact him at :
mailto:[email protected]
==========================================================
In being search for nice lisp programs I found your page
It looks very useful, I hope I'll be able to use some things.
I think it's a very good idea to make pages like that, I just started to
discover the power of NET, so I do not really know how to seek and
find what I need.
I was looking for answer for many questions (how to..,and how to..), but
now have one (maybe stupid, but I was almost shot by my boss) the question
is: why I can't plot the True Type fonts if they are made in 255 color?
Maybe is this wrong with me..
Kaczor :)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Howzit Peoples,
Today I'm feeling slightly discombobulated. (Look it up, I
did!)
I've had a heck of a week but, South Africa are still doing well in the
World Cup Cricket. (Watch it Aussies, we're going to mollicate you on
Sunday).
AfraLisp News
Don Jacobsen
Richland, WA, USA
=========================================================================
G'day Kenny
In your last e-mail message, dated 6/1/99, you mentioned that this is the
last year of this century. I beg to differ with you. The year 2000 will be
the last year of the 20th century. That is why it is called the 20th
century. It takes 100 years to make a century and since there was no year
0, a century goes from year 1 to year 100.
So I will forgive you for this tiny mistake as you do such an excellent job
on the AutoCAD stuff. But please no more slip-ups on the century stuff in
the future.
Regards,
Mark
=========================================================================
Hey Mark, why have one party when you can have two!!!
=========================================================================
In response to Andrew's question regarding lisp functions and
continuing lisp routines between drawing sessions. I had a similar
problem with wanting to plot multiple drawings. I came upon the
realization then, that lisp, no matter how you slice it, ALWAYS ceases
to continue after opening a new drawing. ie. once the "OPEN" command is
used the lisp routine is broke and will not continue. However, I came
upon a solution which you may find valuable. Rather than write my lisp
program in a xxxx.LSP file I wrote the program in script (xxxx.SCR)
format. The difference is that script will not interrupt because of an
open command. The only minor modification you must do is add the command
"RESUME" as the last command in your S::STARTUP lisp routine and all is
well. The script will continue until the program is complete.
Alternately, you can temporarily add the name of the lisp routine to the
S::STARTUP routine to execute automatically upon opening of the drawing.
This is good if you are using an external database for drawing names and
such that will be lost when the variables are cleared between editing
sessions. Below is an example of a script file.
open "next_dwg"
saveas "new_name"
(c:my_lisp_routine)
save
open "next_dwg"
saveas "new_name"
save
etc....
etc....
etc....
===========================
(defun s::startup()
(command ".saveas" new_name)
(my_lisp_routine)
(command ".save")
(if next_dwg
Keith Blackie
BCI Computer Solutions
mailto:[email protected]
=========================================================================Tha
nks Keith.....
=========================================================================
Kenny,
Thank you for your "Creating Macros" tutorial. It helped me understand
the basics of writing my own menu.
Anyway, I have a question. I would like to create a simple pull down menu
that opens an html document located on my hard drive. The line in my menu
looks like this:
ID_MnSTD [&Standards]
ID_STD [MBIA-SBD CAD Standards]^C^Cbrowser;c:\temp\Standard.htm
I realized as soon as I ran this the first time that the backslash "\"
kills my intentions. It seems that I need the path to be read as a whole,
but I don't have a clue as to how to accomplish this.
Any suggestions you have would be appreciated and again thank you.
Robert
*****************************************************
Robert T.Cunningham
Matsushita Battery Industrial Corp. of America
Storage Battery Division
Telephone Number: (706) 569-9979
Internet Address: mailto:[email protected]
========================================================================
Robert,
This should work for you. You may have to change the path statements
to suit your setup :
The first part is the name of the AutoLisp function, namely 'startapp'.
The second quoted section is the path to the application you want to start.
(Explorer or Netscape?)
The third quoted section (which is optional) is the name of the file that
you would like to open in the application.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
****************************
Oh, We are cheerful today, aren't we? That's because I've just
been sat here chuckling, and thinking of some of the stupid
things that I've done (or people working with me have done),
whilst working with AutoCAD and AutoLisp.
Here's a few of the more memorable :
iii) When asked to clean up your drawing directory and move all
completed drawings to the archives, don't move all the
system, PCP, VBA files as well.
vi) Don't try and plot using 3mm thick cardboard as a plotter
medium. It doesn't work and tends to damage the plotter.
(Believe it or not, he got one plot before things
went haywire.)
Don't mess with the system registry, etc. unless you really
know what you are doing.
(I know you warned me Randall, but I had to fiddle.)
Safe Mode here we come....
This weeks tip may seem quite basic to some of you more experienced
AutoLispers. If that is so, just close your eyes when you read
the next section.
Setq is the basic assignment function and probably the most widely
used function used in AutoLisp, but I still see a lot of coding
written like this :
(setq a 26.0)
(setq b "Bolt")
(setq c pt1)
(setq d a)
But did you know that you can also write the preceding code
like this :
(setq a 26.0
b "Bolt"
c pt1
d a
)
As you can see, it saves a lot of typing, (which means less room
for error) and is much more efficient and faster.
===============================================================
Have you downloaded Volo View Express yet?
This AutoCAD 2000-compatible viewer supports DWG, DXF, and DWF
files as well as ACIS solids and embedded raster images. You
can view multiple layouts and control layer display and named
views. The download is large (15Mb Full Install; 10Mb Minimum Install) but
is
well worth it and it's FREE!!!
You can download at : http://www.autodesk.com/volo
=================================================================
Letters :
Dear Kenny,
Just to let you know that I have put a link to your site
on my CAD Links page. I hope you don't mind. I've kept
my CAD web page going as a hobby over several years
and have quite a few links on it now. I do not require
that you put a reciprocal link on your page, you can if
you want and may be call it " Australian CAD Links ".
If you do want to put a links in (or just have a look) a
direct URL to my CAD page (bypass my framed index)
Go to :-
<http://www.users.bigpond.com/johncoom/johncooc.html>
If you want to see all of my Framed website, click below
All the best yours John
John Coombes Melbourne Australia
mailto:[email protected]
http://www.users.bigpond.com/johncoom/
==================================================
John has got a lot of interesting stuff on this site, and it's not all
AutoCAD.
===============================================================
Thanks to Dave for this little tip:
When viewing a DWF file and selecting About WHIP! from the
right-click shortcut menu, a Description section is shown.
How can information be entered into this section?
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Hi Everyone,
I've posted a few new thingy-me-jigs on AfraLisp :
When you go downstairs to talk to the new young and cute receptionist - make
sure your zipper isn't open. (And I thought it was my great sense of humor
that was making her giggle.)
When making degrading comments about the boss - make sure he isn't standing
behind you.
When you type in delete *.* at the DOS prompt and it says "are you sure you
want to delete everything?" Be sure your current directory isn't the root
drive of C:
Before calling me for help because the "erase" command in AutoCAD doesn't
work - make sure you are typing it in correctly at the command prompt.
mailto:[email protected]
===============================================================
I enjoy your web site you are providing a great service to those of us in
the cad arena especially in the area of VBA and AutoLisp programming. I
notice that most of your VBA code is based for AutoCAD R14 have you had a
chance to check any of the new features of AutoCAD 2000.
Thanks,
Michael J. Smith
Greetings, Michael
================================================================
Thanks Michael, I've fixed it.....
================================================================
I'll leave you with this :
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Ground Control to Major Tom,
I've got something quite different this week that I think you all will like.
Randall Rath the "Wonder Llama", has deemed to come down off his mountain
top and contribute some words of wisdom to this newsletter. Enough said,
over to Randall......
=================================================================
Lisp Manager
Lambertus Oosterveen asked for a lisp manager that would show a list of all
lisp files in a given directory and the first couple of remark lines for
each file. I teamed up with Ralph (My wonder Llama from Tibet) to get the
job done, so we are pleased to present Power Tool # 42 (Exclusive to
AfraLisp readers: for $42.00 you can have a stand alone VB project that will
load the selected lisp file into AutoCAD or add all of the selected files as
a menu. Contact Ralph, he has all of the details)...
You will need to open your VBA editor with a new project and add to it a
user form and a normal code module (if you have no idea how to do this, both
Kenny and I have pages on our sites that explain this rather well, but mine
is better) [Who say's so - Kenny] Set the name property of the form to
frmLispManager, don't worry about the name of the code module - the default
name "Module1" is fine.
Arrange the controls however you like to begin with, after you have added
all of the code and run the application, you can move them to an
aesthetically pleasing position and size them to your fancy (Ah, the power
of VBA)! For the form paste in this code:
Sub LispManager()
frmLispManager.Show
End Sub
'End Code Block
You can then run the Lisp Manager Macro to see the whole project work. Hey
Lambertus, What do you say to adding a few more functions then sending this
into Cadalyst or entering it into the VBA macro contest at AutoDesk?
=================================================================
Thanks very much for this application Randall. If you are having problems
building this application, I will have it posted on AfraLisp in the near
future.
Randall can be contacted at any of the following :
URL - VBDesign. http://vbdesign.hypermart.net
E-Mail - VBDesign. mailto:[email protected]
E-Mail - Randall Raath. mailto:[email protected]
Just for interests sake (and to show Randall that I'm as clever as he is), I
decided to build a similar application using AutoLisp. Here's the coding :
: list_box {
key = "selections";
width = 80;
}
: row {
: spacer { width = 1; }
: button {
label = "&Select File";
key = "accept";
width = 12;
fixed_width = true;
}
: button {
label = "&Edit File";
key = "edit";
width = 12;
fixed_width = true;
}
: button {
label = "&Load File";
key = "load";
width = 12;
fixed_width = true;
}
: button {
label = "&Cancel";
is_cancel = true;
key = "cancel";
width = 12;
fixed_width = true;
}
: spacer { width = 1; }
}
///DCL coding ends here
(setq flist '("This List Box will Preview the first 10 lines of"
"a selected Lisp File. Just click on the Select File"
"button to open the Lisp File Dialog Box"
"*****************************************************************"
"If you would like to open the lisp file to edit it"
"in Notepad, click on the Edit File Button."
"*****************************************************************"
"To load the Lisp File click the Load Lisp Button."
"*****************************************************************"
"Brought to you by AfraLisp -
http://members.tripod.com/~kramage/"))
(showdialog)
(princ)
);defun
(defun getlines ()
(repeat 10
);repeat
(close fname)
(princ)
);defun
(defun showdialog ()
);not
(exit)
);if
(start_list "selections")
(end_list)
(progn
(mode_tile "edit" 1)
(mode_tile "load" 1)
(progn
(mode_tile "edit" 0)
(mode_tile "load" 0)
(action_tile
"edit"
);action tile
(action_tile
"load"
);action tile
(action_tile
"accept"
);action tile
(action_tile
"cancel"
);action_tile
(start_dialog)
(unload_dialog dcl_id)
(if userclick
(progn
(getlines)
(showdialog)
);progn
(if userclick1
(progn
(if userclick2
(progn
(load lname)
);defun
(princ)
;;;AutoLisp Coding Ends here
================================================================
Again, I will have this application posted on AfraLisp soon.
================================================================
I received this from Ezhini Natarajn
Hi Kenny,
I want to use each of the elements in the list called NameList1 in the
place of the variable LayerName. So, the function makes so many layers
one after another using the names in the NameList1.
I think some how I could use "mapcar". But I am not sure how I would do
it. I would greatly appreciate any help from you.
-Ezhini Natarajn
=================================================================
Here's the solution I sent him :
(repeat 5
(makethelayer name)
);repeat
(princ)
);defun
);defun
(princ)
=================================================================
I also received a great tutorial from Nir Sullam showing how to create a
Progress Bar in DCL:
Did you know that you can move, delete, copy, and rename files that
are in any of the AutoCAD directories from within AutoCAD? To try
this, click File | Open to open the Select File Dialogue Box. Now
highlight one of the files or folders, then right click to open the
menu that allows you to manipulate the files.
You can also move folders inside of other folders to create a tree
structure for drawing files. If you set up a drawing file folder
using Windows Explorer in your AutoCAD directory, you can even
manage your drawing files this way. Don't forget to set up the
AutoCAD preference area to point to your drawing file folder. Just
be careful what you modify, because you could really mess up your
support files.
================================================================
I've also updated the AfraLisp VBA Quick Tip's page with a couple of little
gems. Point your browser to:
http://members.tripod.com/~kramage/vbatips.htm
================================================================
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Peace and Goodwill to all Mankind.
How be you all. I be fine. Bit of a quite week. Not much e-mail for a
change. (It must be my deodorant.) Couple of new things on AfraLisp that you
may be interested in.
Firstly, I've started an AfraLisp Message Board. So if you're looking for
help and advice pertaining to AutoLisp or VB, leave a message and I'm sure
some kind sole will help you out of your dilemma.
I'm working for consulting engineers in Cape Town and I am looking for a
lisp routine that will allow me to :
1. Pick points in my drawing which extract automatic the X,Y and allow me to
enter the Z and a description and
2. A routine that draw the batter ticks on a slope.
Thanks
Hi there Kenny
I thought you might like to know that I have solved my menu problem. The
problem is with the first line 'menugroup=test'. Your tutorial does not show
the = symbol in the first line. I just thought you would like to know,
because there might be other people out there battling to get there menus
running as well.
Regards
Adrian Flack
mailto:[email protected]
=======================================================================
Superb Site! Why is it that one has to go a third of the way around
the World to find a decent CAD Site? No matter --Your Site is one
of the best I have visited if not THE BEST.
I agree with you on the idea that the error routine is not
documented very well from AutoDesk along with a couple dozen
other items. Very confusing!
Also have a FEW routines that do not work the way that I would
like. Don't know how you feel about working on NOVICE LISPERS
problems but let me know if you have the time to take a peek.
Thanx in Advance;
Scrutch
mailto:[email protected]
=======================================================================
Scrutch???????
=======================================================================
I went to see the doctor yesterday :
Me: "Doctor, I can see into the future".
Doctor: "When did this start?"
Me: "Next Monday......."
=======================================================================
Enjoy your weekend.....
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
****************************
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
My new Acad2000 package has gone on walk-about. It was put on the truck in
Windhoek and was never seen again. It was supposed to be delivered to me on
Wednesday but now it looks like I'll have to wait for another two weeks for
another copy to be dispatched. Well, this is Africa!!! I'm sorry for not
being able to answer the numerous Acad2000 queries that I receive, but I am
saving them and will get around to dealing with them as soon as possible.
Regards,
Mark
==========================================================================
Mark, if the speed of dark is zero then what happens if it slows down even
further to say -100. Does this mean that everything starts to look like a
negative photograph?
==========================================================================
Hey there Kenny - Ken Dispoto here.
I'm the fellow who asked for your help in getting a plot date stamp lisp
routine.
Thanks for putting one together - I works pretty good!
My question today is not as involved (I don't think).
I would like to find a way to insert symbols (fuses, contacts, sw's, etc)
into a horizontal or vertical line and have the line break around it. Have
you anything tucked in your bag of tricks?
Ken D...
==========================================================================
Hi Kenny,
Thanks in advance,
Tim K.
===========================================================================
O.K. guys, I get the message. You will find a tutorial complete with a
sample application for Auto-Breaking Blocks on AfraLisp at the following
URL:
http://members.tripod.com/~kramage/lisp52.htm
Now don't ever say that I'm not good to you!!!
===========================================================================
Hi Kenny,
Do you know if there is a Lisp Manager available that shows all the Lisp
routines in a chosen directory at the left and the first REMark lines in
the Lisp routine at the right.
I think with such an application a lot of AutoCAD users would be very happy.
Best regards,
Lambertus Oosterveen
mailto:[email protected]
===========================================================================
Sounds like a good idea. Anybody know of anything like this?
===========================================================================
Dear Kenny,
I Am still quite new to VB, as you might guess from my question none the
less I am trying. I need to code for simple tasks such as cut, copy, paste,
bold, and align. I would be grateful for your expert help,
Thank you Kindly
Ronnie van Wyk
Mailto:[email protected]
===========================================================================
What is the VBA equivalent to EntGet in AutoLisp and how do you extract the
dxf codes of AutoCAD entities.
John Rodrick
mailto:[email protected]
===========================================================================
Did you know that light reflects off water at 42 degrees to make a rainbow?
===========================================================================
This code below gets me the name of the group of an object in AutoCAD, along
with the name is a description field in the group command in AutoCAD how do
I access this in VB. I can not find a property for the value that is in the
description field when I create a group in AutoCAD.
Private Sub Command1_Click()
Dim AcadApp As Object
Dim AcadDoc As Object
Dim gpitem As Integer
Set AcadApp = GetObject(, "AutoCAD.Application")
Set AcadDoc = AcadApp.ActiveDocument
AcadApp.Visible = True
If Err Then
Err.Clear
'Start AutoCAD if it is not running.
Set AcadApp = CreateObject("AutoCAD.Application")
If Err Then
Most people got married in June because they took their yearly bath in May
and were still smelling pretty good by June. However, they were Starting to
smell, so brides carried a bouquet of flowers to hide the b.o. Baths equaled
a big tub filled with hot water. The man of the house had the privilege of
the nice clean water, then all the other sons and men, then the women and
finally the children. Last of all the babies. By then the water was so
dirty you could actually loose someone in it. Hence the saying, "Don't
throw the baby out with the bath water".
Houses had thatched roofs. Thick straw, piled high, with no wood
underneath. It was the only place for animals to get warm, so all the pets
dogs, cats and other small animals, mice, rats, bugs lived in the roof.
When it rained it became slippery and sometimes the animals would slip and
fall off the roof. Hence the saying, "It's raining cats and dogs," There was
nothing to stop things from falling into the house. This posed a real
problem in the bedroom where bugs and other droppings could really mess up
your nice clean bed. Therefore, they found that if they made beds with big
posts and hung a sheet over the top, it addressed that problem. Hence, those
beautiful big 4 poster beds with canopies. The floor was dirt. Only the
wealthy had something other than dirt, hence the saying "dirt poor". The
wealthy had slate floors that would get slippery in the winter when wet. So
they spread thresh on the floor to help keep their footing. As the winter
wore on they kept adding more thresh until when you opened the door it would
all start slipping outside. A piece of wood was placed at the entryway,
hence a "thresh hold".
They cooked in the kitchen in a big kettle that always hung over the fire.
Every day they lit the fire and added things to the pot. They mostly ate
vegetables and did not get much meat. They would eat the stew for dinner
leaving leftovers in the pot to get cold overnight and then start over the
next day. Sometimes the stew had food in it that had been in there for a
month. Hence the rhyme: peas porridge hot, peas porridge cold, peas
porridge in the pot nine days old."
Sometimes they could obtain pork and would feel really special when that
happened. When company came over; they would bring out some bacon and hang
it to show it off. It was a sign of wealth and that a man "could really
bring home the bacon." They would cut off a little to share with guests and
would all sit around and "chew the fat."
Those with money had plates made of pewter. Food with a high acid content
caused some of the lead to leach onto the food. This happened most often
with tomatoes, so they stopped eating tomatoes... for 400 years.
Most people did not have pewter plates, but had trenchers - a piece of wood
with the middle scooped out like a bowl. Trencher were never washed and a
lot of times worms got into the wood. After eating off wormy trenchers,
Bread was divided according to status. Workers got the burnt bottom of the
loaf, the family got the middle, and guests got the top, or the "upper
crust".
Lead cups were used to drink ale or whiskey. The combination would
sometimes knock them out for a couple of days. Someone walking along the
road would take them for dead and prepare them for burial. They were laid
out on the kitchen table for a couple of days and the family would gather
around and eat and drink and wait and see if they would wake up. Hence the
custom of holding a "wake". England is old and small and they started
running out of places to bury people. So, they would dig up coffins and
would take their bones to a house and re-use the grave. In reopening these
coffins, one out of 25 coffins were found to have scratch marks on the
inside and they realized they had been burying people alive. Therefore,
they thought they would tie a string on their wrist and lead it through the
coffin and up through the ground and tie it to a bell. Someone would have to
sit out in the graveyard all night to listen for the bells. Hence on the
"graveyard shift" they would know that someone was "saved by the bell" or he
was a "dead ringer".
===========================================================================
Have nice weekend.....
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
http:\\members.tripod.com\~kramage\birth.htm
Enjoy..............................
==========================================================================
Oh, by the way. I've updated Randall Raath's "A Code A Day". The whole of
the month of August is now available for download. You can find it at :
http:\\members.tripod.com\~kramage\rr\rr.htm
==========================================================================
No letter's this week, I'm afraid, 'cos it's our birthday, but here's
something you may enjoy.
As Always,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp :
http:\\members.tripod.com\~kramage\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Greetings Earthlings,
I must apologize for missing last weeks letter but
I've been down with the flu and I've (Again!!) been away on business.
(Botswana this time...)
This week I'm going to dedicate the letter to readers questions. So please,
if you think you can help, drop the poor soul a line and try and put him/her
out of his/her misery. (Got to be politically correct you know.) Here we
go...
Letters :
Dear Kenny
I've found your tutorials very helpful and I would be very grateful if you
could help me solve a problem.
I need to write a lisp routine which gets its variables from another file
(*.txt or *.xls). How do I open the file and get the variable values?
For example, if I want to draw a rectangle with points a,b,c,d and I have a
file where a=2,3 b=6,3 c=6,5 d=2,6 in one instance and different values for
a,b,c,d in another instance, how should I write the AutoLisp code for
opening a file to refer to its data, run the AutoCAD commands and then close
the file?
Please send me a small example. I need it very much to enable me to get
employment in a drafting firm.
Please e-mail me at mailto:[email protected] soon.
Thank you very much
Mark Misquitta
(an Indian who has just migrated to Australia)
=======================================================================
Sir,
I'm taking the liberty of approaching you with a specific problem that I
can't seem to solve, even with a pile of manuals, as the manuals only seem
to cater for procedures providing everything goes right first time.
Judging from the material that you published it appears as if you know
what your talking about.
Problem :
When loading a partial menu using the "tools , customise menu" method, the
partial menu that is loaded is lost every time the program is closed. Why
does it only loose only certain partial menu's? Is there a link between
the loaded partial menu and the actual location of the said menu? In this
case, I placed all the partial menu's in the "support" folder, where all the
standard menus reside. Surely there should be no problem finding the
partial menu upon starting up. What points the starting up procedure towards
the
specific partial menu?
Please help, the so called boffin supplier that I bought the software from
doesn't know how.
Regards
Andreas Blignaut
Johannesburg
mailto:[email protected]
=======================================================================
Kenny,
I am trying to extract a "Bill of Materials" from my drawings. The
attributes
are a product code number and a quantity. The idea being to export this
information into a spreadsheet where pricing etc will be added. I use
attributes that are assigned to blocks and therefore when I insert the block
into the drawing I can select which attributes are required for the project.
The problem being if I assign say ten attributed to one block and then array
that block twenty times then extract the attributes to a comma delimited
file I end up with twenty lines of junk, which have to be processed before
dumping them into a spreadsheet. (which I have not managed to accomplish.)
Code Qty
QSCB25 123
QSS150 300
etc.
Regards
Paul
mailto:[email protected]
=======================================================================
Hi Kenny,
Here is a trial I made and got stuck!!! Please see how I can get over the
hurdle here:
;Dwginfoi.lsp
;Collects pieces information about the drawing and attaches
;them as extended entity data to a selected entity
;----------------------------------------------------------
;**** MY QUESTION ****
;How can I collect the information such as dwgname, dwgprefix, date, time
;etc and then construct a list to pass that as the -3 associative and
;append that to the existing entity data list?
;----------------------------------------------------------
(defun c:dwginfoi (/ UserName ThisDwgName ThisObject OldXDataList
NewXDataList a1 a2 b1 c1)
(setq
UserName (getvar "loginname")
ThisDwgName (getvar "dwgname")
(setq ThisObject (entsel "\nPick an Object")); Here I let the user pick an
object, later it will be automated to pick a certain block using tblsearch
(setq OldXDataList (entget (car ThisObject)))
(regapp "EzXData")
(setq NewXdataList (append OldXdataList c1));Here i am trying to append the
list c1 to the existing entity data list
(entmod NewXdataList)
);end of lisp
(princ);exit quietly
;-------------------
Thanx Kenny.
-Ezhini
mailto:[email protected]
=======================================================================
Hi. I have a question regarding VB for AutoCAD.
I don't have any knowledge about VB/VBA for ActiveX AutoCAD.
I am looking for a most convenient way to simulate 3D objects for my
project.
I have a project which needs to simulate a robot arm graphically.
Can VB/VBA simulate the arm which has six joints? The graphical joints
should be controlled independently with certain angles and lengths
according to user's input. Is it too complicated for VB? Or is there any
other way for my purpose rather than using C++ with other graphical
libraries?
Please, help me out. I'd like to be in a right direction.
Thanks.
Yong-Kwon Cho
mailto:[email protected]
=======================================================================
Hi Kenny.
I have viewed the AfraLisp page and have a question. We have a database in
Microsoft Access. The database contains data on various points. Such as
height of an object, type of the object and so on. This information is then
required to be used in AutoCAD to draw the point at the coordinates given
along with selected characteristics of the point. Sometimes the points are
not continuous. Do you have any suggestions.
Joseph Sukhnandan
mailto:[email protected]
=======================================================================
Dear Kenny
I contacted you last week with regard to attribute extraction. You suggested
I read your Exbolt.lsp file which I have
done, and I learnt a great deal in terms of modifying entity lists, but I
have to admit I am lost (two bottles of Bell's later!) and need your advice.
Lets assume I want to assign two bolts to the selected hole (God knows
why!!!), how do I modify my entity list to show both bolts and their
respective sizes and grades, and in fact repeat should I want to select yet
another bolt, and inform the user?
Paul Butler
Durban, South Africa
mailto:[email protected]
=======================================================================
Kenny
Dave Dormer
mailto:[email protected]
=======================================================================
Kenny,
I posted a message earlier and it is not on the board anymore. I
have not
look recently for responses, have I missed it or is there a way to look at
it again. The subject was auto purge in mechanical desktop.
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http:\\members.tripod.com\~kramage\
mailto:[email protected]
****************************************
Welcome Lisper's and VB'rs,
I don't know if you are aware, but it will
be AfraLisp's first birthday next week Friday. (3rd September.) I am going
to have something *special* available for you on AfraLisp to celebrate our
coming of age, so pop along on Friday and have a look. Remember, it will
only be available Friday the 3rd:-)).
By the way, it's a long weekend this weekend in Namibia. I will not be in
the office from Thursday through till Sunday. (I'm going through to Luderitz
with the band for the German carnival. Oh my poor liver!!!) So, if you send
me any e-mail and I don't reply immediately, you know the reason. I'll try
my best to get back to you sometime on Monday.
=========================================================================
I received a cracker of a Visual Basic application from Ramon Castro
(mailto:[email protected]). called RC-Batcher. This is a very useful
tool that allows you to select multiple files from multiple directories, and
then run any user defined AutoLisp routine against them. Very, very handy
for batch processing. You can find it at :
http:\\members.tripod.com\~kramage\vba14.htm
=========================================================================
Letters:
Hi the Kenny
A quick query!! (even though the answers are not always so quick.)
What is the difference between Lisp, Visual Lisp, and Visual Basic, and
which would you say is the best to use for writing programs for AutoCAD?
(Using Release 14.) If Visual Lisp is the way to go, where can I get a
compiler/editor?
Regards,
Adrian Flack
mailto:[email protected]
=======================================================================
Adrian,
AutoLisp is a subset of the Lisp language specially modified to suit
AutoCAD. The AutoLisp interpreter is build into AutoCAD therefore, AutoLisp
files do not need to be compiled. Visual Lisp is a new version of AutoLisp
that is basically the same except that you can compile the AutoLisp files.
It also has it's own graphical interface that you must use to be able to
edit and compile the files. (Normal AutoLisp can be edited using any ASCII
text editor such as Notepad). Visual Lisp and any subsequent compiled
AutoLisp files can only be used with R14 and R2000. You have to purchase
Visual Lisp for use with R14 (available from Autodesk) but it is build into
R2000.
I've lost count the number of times I've been asked that question. As far as
I'm concerned, it's not a difficult question to answer. Use both......
Each of them have got their strengths and weaknesses.
I mean, look at AutoCAD's DCL language. It's a positive pain in the
posterior designing dialogs in AutoCAD whereas, with VB it's a pure
pleasure.
And the AutoLisp coding for dealing with dialog's? Say no more!! (If you
don't believe me have a look at the AutoLisp code required to hide a
dialog.)
On the other side, look how simple it is to deal with blocks in AutoLisp. I
still haven't figured out how to explode a block in VB without resorting to
coding that sends commands to the command line. AutoLisp also deals with
lists in a much more friendlier manner than VB. (Well I think so, so
there!!)
And having to declare all your variable types in VB really threw me at
first. I can now see the reasoning behind it and it does result in faster
more elegant application.
It's difficult to say when and where to use AutoLisp or VB. If you are
having to deal with the operating system or external files, then VB is
definitely the route to take. On the other hand, if you are doing fairly
straightforward AutoCAD based programming then I would stick to AutoLisp.
I must also mention, that it is much easier to protect your source coding
using VB or VBA. I know you can compile your AutoLisp files if you use
Visual Lisp, but have you seen the size of file that is returned?
So, I've had my say and you've heard the verdict, so stop reading and start
learning AutoLisp AND Visual Basic......
Just one more thing on the same subject. To run VBA you will need to have a
basic understanding of AutoLisp because AutoLisp "triggers" the VBA
programs. My advice to you would be as follows :
Also, at this stage in time, you will find a lot more information on
programming using AutoLisp than you will on VBA in regards to AutoCAD.
David,
VB is a standalone application that can do everything VBA can plus
more. VBA is a subset of VB specifically design to suit the application that
it is developed for. (e.g.. You get VBA for Excel, VBA for AutoCAD, VBA for
PowerPoint, etc.) VBA is not standalone but is part of the host application.
It has certain characteristics, (controls, properties, etc.) designed to
suit that application. VB can access all of the VBA functions build into an
application by creating a reference to that application. If you are working
with AutoCAD R14 or R2000, VBA for AutoCAD is part of the program, whereas,
if you wish to use VB, you will have to purchase it separately. Hope this
explanation helps.
=========================================================================
Mark Misquitta wrote in last week asking for help on Reading and Writing to
external data files. Keith Blackie very kindly sent in this reply:
Mark,
I have spent a great deal of time writing routines which read data from
files within autolisp and I believe I have an example which might be of
use to you.
The first thing I am going to do is assume that you are familiar with
autolisp enough to construct a viable function.
What we need to do first is obtain the file which has the data to be
read into the function. This could be a static name or one which is set
dynamically by the user. Here are examples of each:
(setq file_name "rect.dat") ;;; this is a static name which will never
change
(setq file_name (getstring "\nData file name: "));;; user types in file
name dynamically set
(setq file_name (getfiled "Data Files" "" "" 8)) ;;; dynamically sets
name through AutoCAD dialog box
Now that we have the file name saved as file_name we can now commence to
opening it. We must save the file handle to a variable otherwise you
cannot close the file and you cannot access the data contained within
it. Example follows:
The lower case "r" is a case sensitive notation that the file is open
Ok, now we know what file to open and we have opened it and saved the
file hande to a variable name FN, so now what...
We can now read the information contained within the file a couple of
different ways. One it to read each line and the other is to read each
character. For simplicity I will only cover the reading of the lines.
This looks good but.. We must continue reading the file and assigning it
to variables until the entire file is read ... or until the desired
number of variables are read from the file. Then we must close the file.
That is easy.
(defun c:fread()
(setq file_name (getfiled "Data Files" "" "" 8))
(if (setq fn (open file_name "r"))
(progn
(setq data_string (read-line fn))
(while data_string
(subroutine_to_handle_data)
(setq data_string (read-line fn))
)
(close fn)
)
(princ (strcat "\nCannot open " file_name " for reading! "))
)
)
If you want to cut and paste the final example, you can do so and use it
as a working example, just define the data handling routine and you will
be in business.
Keith Blackie
Owner
BCI Computer Solutions
mailto:[email protected]
========================================================================
Thanks Keith for your concise explanation. Looking forward to more of the
same :-))
Andreas as far as I am aware the problems you are experiencing are caused by
the following:
If you are using R13 it is a bug in the system, try typing .quit at the
command prompt to save your settings. The point before quit is important.
If you are using R14 it might be necessary to load the .mnu file instead of
the .mns file. Just be careful doing this, because any changes made to the
mns file and not the mnu file will be lost when loading the mnu file. You
could also try .quit and see if that works. The reason for using .quit is
that some users undefine the quit command.
Regards
Adrian Flack
mailto:[email protected]
========================================================================
Thank's guys, it's always nice when people respond to other people's
problems.
========================================================================
Hey Kenny!,
Haven't spoke in a while. I thought I would drop a line and ask if you would
mention a company at your web site.
The story:
I recently needed to convert an old SHX AutoCAD font originally created by
my boss for AutoCAD R10 to AutoCAD R14 in a TTF font. Since Acad dims use
mtext, and mtext uses TTFs, this was a logical path. The SHX font contained
half-stacked fractions in 16th increments. We wanted something that could be
inserted into mtext, via the mtext editor, like you can a symbol font. We
originally tried to create from scratch the Unicode version like my boss did
for the SHX version. Too difficult for me, so I located a company via the
web:
David W. Edwards - Dave Edwards Consulting - Maker of TC Fonts
mailto:[email protected]
http://www.tcfonts.com
The original contact was back in March of this year. I had forgotten all
about it, until I received an e-mail three weeks ago from Mr. Edwards. Below
is the pasted copy of his e-mail:
Mr. Farley...
I'm sorry I haven't gotten back with you sooner, but some time ago you asked
about creating a TrueType from a custom SHX. We normally don't have a
problem with these but several of your characters blew our custom programs
out of the water. It took "forever" to figure out what going wrong.
That all said - attached is a TTF font that matches your HROMANS. We have
also included a custom Hromans.SHX. In order for this to work, the custom
character have to be copied to different locations (a Windows TTF)
requirement. You should use the new SHX file (store your original in a safe
place just in case). The custom characters start at ASCII 160.
I have also included a DOC on how to make the SHX use the TrueType in Text.
Because of the delay, there will not be a charge for this. Let me know if
you have any trouble and let us know if we can do anything else for you.
David W. Edwards
I followed his instructions in the very detailed document he sent me and the
font works PERFECTLY! This company's behavior, and specially Mr. Edwards',
is truly a class act. In all of my years in the computer industry I have
never experienced a vendor with this level of customer satisfaction. I had
forgotten that he was working on it!
);progn
);if
(princ)
AGENT:
Grabbing bastard. Usually suffers from amnesia.
FLAT WEEK:
Disease with often fatal results. Symptoms: Frequent
phone calls to other agents, stabbing pains in the bank
statement. Only known cure is liberal application of
overtime, three times daily.
CLIENT:
A person who is convinced that he knows what he wants,
better than any self-respecting contractor. Usually
proved to be incorrect.
OVERTIME:
Time specified for doing work which was impossible,
for many reasons, to complete during normal
hours i.e. private work, long lunches, etc.
DOUBLE TIME:
Heaven, the contractor's ultimate ecstasy.
FRIDAY:
Payday. Can also be day on which D.C.M'S are awarded.
IMMEDIATE REQUIREMENT:
Expression used by agents, which means "You will not hear
anything more about this job for six months."
RATE:
An imaginary figure for a job. Always less than the
correct figure.
AGENTS MARGIN:
A supposedly small figure which is capable of doing big
things, like buying big cars and foreign holidays.
LOCAL CONTRACT:
A job within 1000 miles of your home.
OFF-SHORE CONTRACT:
Must be able to swim to work without getting drawings wet.
CV:
RESUME:
A set of lies submitted to client by an agent bearing no
resemblance to the above-mentioned set of lies.
JOB SATISFACTION:
Something only occurring on the last Friday of each month
(payday).
GRUB-SCREW: (n.Latin)
Term used to denote contractor having dinner date
with attractive female staff member (usually very
rare).
INTERVIEW:
One and only opportunity for client to try to
impress contractor with his expertise. (Seldom
effective due to persistent questions about rate).
TAX INSPECTOR:
1. Evil being, demoniacal thing .
2. Nasty bogey man used to frighten infant
contractors if they are naughty.
TIME SHEET:
1. Agency Time Sheet - 2nd most important piece of
paperwork after salary cheque.
2. Client Time Sheet - A device invented solely to
annoy and wake up contractor for at least 10 minutes per
week.
EXPENSES:
Money expended by contractors in legitimate course
of his business. i.e. booze bills, squash club fees,
gambling accounts, etc.
DEMOB HAPPY:
State of euphoria existing in last seven days of contract.
STATUTORY HOLIDAY:
Government legislation designed to reduce
contractor's income.
CONTINGENCY PLANNING:
Constantly having CV updated and ready for
E-Mailing.
ENGINEER:
Lowly paid contractor-in-training. (See also under
"Staff man".)
DECISION:
Almost extinct. Lack of this item responsible for
huge quantities of wasted work and a contractor's major
source of income.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
Hi Everyone,
I bet you're all wondering why AfraLisp changed URL's? Very
simple really. I started to receive numerous E-mails from AfraLisp visitors
stating that they were having problems in downloading files. I contacted the
service provider and was informed that they do not encourage downloads as it
slows down their server and they loose advertising opportunities. (??) I was
then told, in no uncertain terms, to desist in this evil, vile and
despicable practice or face a shut-down of the site and possible
assassination. Needless to say, I immediately packed my bags and headed for
the hills, only stopping once for a quick beer. (O.K. two.) Anyway, I hope
everyone likes the format of the new site and have book marked the new
address. (Just in case you haven't, you'll find it at the top and bottom of
this letter.)
Hey guess what? My ACAD2000 package has finally arrived. ;-))) Keep an eye
on AfraLisp for some AY2K orientated applications that I'll be posting in
the near future. (Don't worry, I won't neglect the R12/13/14 users.)
===========================================================================
Here's a couple of AutoLisp/VBA links you may be interested in looking at :
AutoLisp Programming
http://pw1.netcom/~rogh/autolisp.htm
Some good basic AutoLisp Programming Examples
Letters :
I am an AutoCAD R14 user and lisp programmer trying to teach myself VBA.
Your AfraLisp site has been a life saver for me during this learning
process. (I have it set as my homepage). I have two reasons for contacting
you.
The first is to request that you e-mail me a zip file that you have posted
on your site called RC-BATCHER.ZIP. I have downloaded it directly, but
when I open it, I get a message that it is not a valid archive.
The second is to ask your advice (if you don't mind offering it) on a small
problem I have encountered writing a VBA program. I have started a program
that collects and displays the title block attributes of a drawing. The
attributes can be edited and the changes can be made to other drawings
within the same directory. I want to provide the option of printing each
drawing that is updated using the Plot.PlotToDevice method. My problem is
this: I added a combo box to display all of the available plot devices I
have set up in AutoCAD. I tried to use the "getplotdevicenames" method to
populate the combo box, but had no luck. The example code in the R14 VBA
help file for this method didn't work. Is there a trick to get this to
work? I am hoping that you have used this before and could send me your
own example code.
Thanks in advance
Stephen S. Sitchcox
Lisper
mailto:[email protected]
==========================================================================
Hello:
In regard to VBA for AutoCAD, is there a way to access the bitmap image
stored
inside of drawing files so that it can be displayed on a form?
Regards,
Ron Dietel
mailto:[email protected]
==========================================================================
I am just starting to read info. on AutoLisp programs. I have a project at
work where I will have to draw up approx. 700 drawings that are identical
except for the length and width, I am using AutoCAD 14, but soon will be
using
Acad 2000 and Mech. Desktop.
I need an AutoLisp or Visual Lisp program where I can have only one AutoCAD
drawing and all other pertinent info. stored in an external database. If I
have to make a change that will affect 100 of these drawings, I would rather
make the changes in a database then to open, revise, save, and close all
these
drawings. I heard that Mech. Desktop has the capability to do this but it
want
allow the user to give each drawing a separate drawing number and also it is
only good for modeling purpose only, please comment. I was also looking at
some of lisp programs in the Into the Database-Page III section. I skipped
over the Page I and II sections and tried to work this lisp and could not
get it to work. Should the part where
it states dialogue coding looks like this: be inserting into the lisp
program
or saved separate, you didn't state exactly what one should do with this.
mailto:[email protected]
==========================================================================
Greetings Kenny,
I was curious if there was a lisp routine out there that you are aware of
that will batch change title block info?
I would like to replace text with a bitmap log or vice versa.
Thanks,
Peter Lanzone
mailto:[email protected]
==========================================================================
Tip of the Week
This week we have a simple but effective Copy/Rotate routine.
There was an draughtsman who had an exceptional gift for fixing all things
mechanical. After serving his company loyally for over 30 years, he happily
retired. Several years later his company contacted him regarding a seemingly
impossible problem they were having with one of their multi-million dollar
machines. They had tried everything and everyone else to get the machine
fixed, but to no avail. In desperation, they called on the retired
draughtsman
who had solved so many of their problems in the past.
The draughtsman reluctantly took the challenge. He spent a day studying the
huge machine. At the end of the day he marked a small x in chalk on a
particular component of the machine and proudly stated, "This is where your
problem is". The part was replaced and the machine worked perfectly again.
The company received a bill for $50,000 from the draughtsman for his
service.
They demanded an itemized accounting of his charges.
Steve Cherry
mailto:[email protected]
==========================================================================
Keep Well and Cheers 'till next week.....
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All code provided as is, with no warranty as to its fitness or use.
E-Mail :
Mailto:[email protected]
AfraLisp URL :
http://afralisp.hypermart.net/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
You can download CADieu Viewer+ (and other free stuff) from :
LOTW :
http://www.geocities.com/RainForest/1073
or CADSyst :
http://www.cadsyst.com/utilc.html#cadviewr.zip
;;Error handler
(setq olderr *error*)
(defun *error* (msg)
(if (or
(= msg "Function cancelled")
(= msg "quit / exit abort")
)
;;if user cancelled or program aborted, exit quietly
(princ)
;;otherwise report error message
(princ (strcat "\nError: " msg))
)
(setq *error* olderr)
(if (tblsearch "UCS" tmpucs)
(command "._UCS" "_Restore" tmpucs "._UCS" "_Delete" tmpucs)
)
(command "._UNDO" "_End")
(setvar "CMDECHO" oldcmd)
(princ)
)
;;Get input
(prompt
(strcat
"\nFLATTEN sets the Z coordinates of most objects to zero."
)
)
;;*initialize variables
(setq ss1len (sslength ss1) ;length of selection set
i 0 ;loop counter
numchg 0 ;number changed counter
numnot 0 ;number not changed counter
numno0 0 ;number not changed and Z /= 0
counter
ssno0 (ssadd) ;selection set of unchanged entities
) ;setq
;;Print results
(prompt (strcat "\n" (itoa numchg) " object(s) flattened."))
(prompt
(strcat "\n" (itoa numnot) " object(s) not flattened.")
)
(prompt
"\nFLATTEN version 2k.01 loaded. Type FLATTEN to run it."
)
(princ)
;;;eof
;;;AutoLisp Code Ends here
==================================================================
Well, that's it for this week. I'll leave you with this thought :
30% of car accidents are caused by people who have been drinking.
But that means that 70% are caused by people that do not drink??
Cheers and have a nice weekend.....
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp URL :
http://afralisp.hypermart.net/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To subscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Subscribe AfraLisp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
http://afralisp.hypermart.net/vba.htm
I've also updated Randall Raath's "A Code a Day" including the download file
for the month of September. You can find this at :
http://afralisp.hypermart.net/rr/rr.htm
=============================================================
Letters :
Hello Kenny,
I contacted you about a year ago when I was learning to program in lisp,
when your tutorials proved very useful. Now I'm a bit further, and I am
CAD-systems administrator at my company. Today I got really p****d off
when I opened a DWG made by one of our two senior designers. A couple of
months ago we implemented a company DWG-standard which included a
statement about dimlfac (contents... it must be set to 1) and about
dimaso (contents.... it must be switched ON). These two senior designers
just refuse to make dwg's according to these standards, because, as they
say, have always used Acad like this. Apparently they totally missed the
concept of advancing technology, and that they are using ACAD2000 now
instead of R10.
Thanks in Advance,
Martijn Budding mailto:[email protected]
=============================================================
...HEY KENNY, I DON'T CARE WHAT ANYBODY SAY, YOU ARE THE GREATEST IN THE
LISP WORLD!!! IN YOUR SITE(AFRALISP) I'VE LEARNED THING THAT I NEVER IMAGING
THAT EXIST.....THANKS!!!!....CONTINUE DOING THAT. A LOT OF PEOPLE ARE
SUPPORTING YOUR SITE HERE IN NEW YORK...KEEP GOING AND GOOD LUCK.
MY PROBLEM:
I'M WORKING WITH A TITLE BLOCK THAT HAVE 26 LINES OF ATTRIBUTES, AND IT
HAPPEN THAT I HAVE TO CHANGE THE 2 VERY LAST OF THEM (CHANGE THE DATE AND
ISSUE).
WHEN THE DDEDIT COMMAND PROMPT ME TO SELECT THE ATTRIBUTE, I SELECT THE
ATTRIBUTE THAT I WANT TO CHANGE AND THE DIALOG BOX APPEARS WITH THE VERY
FIRST ATTRIBUTE
HIGHLIGHTED. I'D LIKE TO KNOW IF YOU HAVE ANY TIP OR LISP PROGRAM THAT ALLOW
ME TO GO DIRECTLY TO THE SAME ATTRIBUTE THAT I SELECT, SO I DON'T HAVE TO
PAGE THE DIALOG BOX TO GET TO THE LAST ON AND THEN EDIT THAT ATTRIBUTE THAT
I WANT TO CHANGE.
MY ANTICIPATED THANKS
LEO REYNOSO FROM NEW YORK
mailto:[email protected]
=============================================================
Hello,
I am having difficulties in exploding a block ref object in R14.0.
Can some body do the trick?
Thanks
Ubaid Ullah Qureshi mailto:[email protected]
=============================================================
Mr. Ramage,
(defun C:1-5MRD ()
(setq counter 0)
(PRINC)
)
Thanks in advance,
Joe Schmidt
mailto:[email protected]
p.s. Make sure you turn off osnaps when you run the code or it will look
funny. I haven't got around to setting my variables for that yet.
=============================================================
I sent Joe this :
;;Start AutoLisp Code
(defun C:1-5MRD ()
(setq IP (getpoint "\nPlease pick insertion point: "))
(setq dist (getdist IP "\nPlease pick deck distance: "))
(setq ang (getangle IP "\nPlease pick direction of deck: "))
(setvar "OSMODE" 0)
(repeat colarr
(COMMAND "PLINE" IP P1 "a" P3 "l" P5 "A" P7 "L" P8 "A" P10 "L" P12 "A" P14
"L" P15 "")
(setq ip p15)
);repeat
(PRINC)
)
;;;end AutoLisp Code
=============================================================
I'd like to finish of with this :
(setq message
(cons "got here from afralisp")
(cons "been there a bit, subscribe to yr letter")
(cons "now iv'e seen the man behind the code")
( cons "and his missus, slurping a bloody great ale")
(cons "not a bad idea, might just do that,, me.)
)
May your projects prosper
I am,
Mike Bawden
mailto:[email protected]
.. click to test .. release to detonate.
Regards,
Kenny Ramage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Mail :
Mailto:[email protected]
AfraLisp URL :
http://afralisp.hypermart.net/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Un-subscribe AfraLisp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To subscribe send E-Mail to :
mailto:[email protected]
In the body of the message type :
Subscribe AfraLisp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
Are you sick and tired of having all those Toolbar Bitmap Files floating
around?
I think you are probably aware just what a pain it is having to remember to
attach the bitmaps along with the Toolbar menu file every time you either
send it to someone, or install the menu on another workstation. (Smiley
Faces here we come..)
The solution to this, is to store the Bitmaps in an ActiveX DLL file. (The
same as
AutoCAD do with their Toolbar Bitmaps.) This article will take you through
the steps required to construct your own customized Toolbar DLL.
http://afralisp.hypermart.net/vba15.htm
TestDCL.Lsp :
by M.P.Saju. mailto:[email protected]
Testing DCL files becomes a necessity when developing a good sized lisp
application for easy input and understanding. This routine in lisp was
written for just such a necessity.
Usage is very simple... Just type "Testdcl" in the AutoCAD text screen and
press
"Enter". A file selection dialog box will open up to select the DCL file.
On entering, the DCL under test will open. This application works under
the assumption that there is an active "accept" or "cancel" button.
http://afralisp.hypermart.net/olisp.htm
===================================================================
Letters :
Our office uses SummaSketch III tablets and Calcomp 4x5 DesignStations.
Currently I have a line in the Acad.Lsp file to load our menu:
(command "menu" "mwacad").
Regards
I am creating an AutoLisp program that will insert a block and then change
certain block attribute definitions based on criteria inputted at the
insertion time. For example, once I insert this specific block, I want to
change the justification of an attribute based on the inserted rotation
angle. Hence this will be specific to each individual block when inserted.
The only way I have figured out this could be accomplished is by (a)
exploding the block (hence leaving it exploded in my drawing) or (b)
exploding the block, redefining it, and saving it again as a redefined
block. I do not want to use any of these two possibilities because (a) I
need the block to remain unexploded and (b) I do not want to change any
previous occurrences of this block already inserted into the drawing and I
also want to keep the original attribute definitions (the definitions set
previous to insertion) for the next time I insert the block.
Thanks,
Greg Lee
mailto:[email protected]
====================================================================
(defun mid (w z)
(list (/ (+ (car w) (car z)) 2) (/ (+ (cadr w) (cadr z)) 2))
);defun
(setvar "cmdecho" 0)
(setq a (cadr (entsel "\nSelect two lines to be joined: "))
b (cadr (entsel))
ai (mid a b)
va (ssget a)
vb (ssget b)
a1 (cdr (assoc 10 (entget (setq ent1 (ssname va 0)))))
b1 (cdr (assoc 11 (entget (ssname va 0))))
a2 (cdr (assoc 10 (entget (setq ent2 (ssname vb 0)))))
b2 (cdr (assoc 11 (entget (ssname vb 0))))
dst1 (distance ai a1)
dst2 (distance ai b1)
);setq
(setq end1 b1
end1 a1
);setq
);if
(setq end2 b2
end2 a2
);setq
);if
(entdel ent2)
(entdel ent1)
(entmake (cdr newlst))
(setvar "cmdecho" 1)
(princ)
);defun
(princ)
Open a new module and enter this under the declarations section of the
module :
Now, insert a new form and enter the following into the Form_Load procedure.
lRetVal = ExitWindowsEx(EWX_REBOOT, 0)
And now here's something rather interesting to finish off this weeks
Newsletter :
Ever wonder why MS applications seem slower with each new release? Read
on...
Apparently the constant rain in Redmond has driven Bill's engineers to
obsessive flights of fancy. Below are instructions on how to access a
little flight simulator that was inexplicably hidden by precipitation
maddened programmers deep inside Excel 97.
In Excel97, open a new blank worksheet.
Press F5. (Go to function.)
Type X97:L97 in the box and click OK.
Now hit the Tab key once. (You should now be in cell M97.)
Now, whilst pressing the 'Ctrl' and 'Shift' keys, click once on the 'Chart
Wizard' icon. (The one at the top with the blue-yellow-red bar chart.)
After a few moments, you should be flying.
Steer with the mouse and accelerate/slow down with the left/right mouse
buttons.
Look for the monolith with the programmer credits.
Exit the program with the Esc key.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
Looking for something specific on AfraLisp? Then why not make use of the new
Search Engine that I've installed. Just enter a keyword, click on the "Go"
button, and a list of links to pages on AfraLisp containing that word will
appear. All part of the service!!
======================================================================
I don't know if you are aware, but there is an application included with
AutoCAD that makes dealing with the operating system a breeze when working
with AutoLisp. This is DOSLib.Arx, designed and distributed by Robert Mcneel
and Associates. http://www.mcneel.com
DOSLib, or DOS Library, is a library of LISP-callable functions that provide
Windows operating system and DOS command-line functionality to various CAD
applications, including AutoCAD and IntelliCAD.
DOSLib extends their LISP programming languages by providing the following
functionality:
* Drive handling functions to change between drives and check disk
space.
* Path handling functions to manipulate path specifications.
* Directory handling functions to create, rename, remove, select and
change directories.
* File handling functions to copy, delete, move, rename, and select
files. Functions for getting directory listings, searching and finding
multiple instances of files, and changing attributes are provided.
* Print handling function to get and set default printers, and spool
files.
* Initialization file handling functions to manipulate Windows-style
initialization (INI) files, and Windows Registry access functions.
* Process handling functions to run internal DOS commands or other
programs.
* Miscellaneous functions, like changing the system date and time, and
displaying Windows message boxes.
I have written a tutorial that will show you how to use some of the various
functions available within DOSLib. You can find it at :
I was wondering if you can help me with the begin command event...I wanted
to
know if I used the following VBA code, could I also have VBA react to a
specific block, as in example two....if a person select the attedit command
to select the rev
block, can I have a VBA form to pop up when they use the command and pick
the
rev block..thanks
;;;code begin
(setvar "ATTREQ" 1)
This code in R14 inserts a block with attributes, then displays the Enter
Attributes dialog box (where the attributes are entered), and the block is
placed in the drawing.
But, in R2000, the Insert Attribute dialog box will not display when called
from an AutoLisp function unless ATTDIA is set to 1, and the INITDIA
function is called prior to executing the -INSERT command.
To do this, the AutoLisp code needs to be as follows:
;;;code begin
(setvar "ATTREQ" 1)
(setvar "ATTDIA" 1)
(initdia)
(command "-insert" "MyBlock" InsertionPoint Xscale Yscale Zscale Rotation)
;;;code end
Hope this answers your question. (I had the same problem myself and it took
me ages to suss out the answer.)
======================================================================
Tip of the Week :
Often, whilst running AutoLisp routines, your system variables can get well
and truly messed up. To alleviate this problem, you can write yourself a
small AutoLisp routine that does nothing more than re-set the system
variables to your standards. Here's an example :
;;;Start Coding Here
(defun reset ()
(setvar "blipmode" 1)
(setvar "cmdecho" 1)
(setvar "highlight" 1)
(setvar "osmode" 32)
(setvar "pickbox" 5)
(setvar "filedia" 1)
(setvar "apperture" 4)
(prompt "\nSystem Variables Re-set to Default...")
(princ)
);defun
(princ)
;;;End Coding Here.
Now, if your variables ever get messed up, you just run this routine to set
everything back to normal. (I have created a toolbar button to trigger
this.)
======================================================================
And now I bid you a fond farewell with this :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
Hi,
Aussies watch out!!!! This Saturday brings the end to your World Cup
Rugby hopes. Score: South Africa 42, Aussies 18.........Watch this Space....
=====================================================================
What's New on AfraLisp
Randall Raath has written two great VBA Basic Training Tutorials. You can
find them at :
http://afralisp.hypermart.net/vbatut4.htm and
http://afralisp.hypermart.net/vbatut5.htm
I've also re-written my Batch Purge application for VBA. You can find "Batch
Purge 2000" at :
http://afralisp.hypermart.net/vba.htm
=====================================================================
Letters :
Hi there
My problem:
Glad to have my site posted on your links page, just wanted you to know
that I moved. The AutoCAD Resource Site is now located at:
http://www.llpsite.com/
You're still looking good. Where do you find the time? Have a great week.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
AfraLisp
http://afralisp.hypermart.net/
mailto:[email protected]
****************************************
Beam me up Scottie,
I'm not going to mention the rugby and I would
appreciate it if nobody else does. Especially if you're an Aussie!!!!
Now I'm going back to hide under my rock. Over to you............
==================================================================
Letters
Hi Ramage,
it selects all lines in PS/MS and any routine to change them to plines just
stops when it can't access ps or ms entities .
Regards,
Manoj Mishra mailto:[email protected]
==================================================================
Dear Mr.Kenny Ramage
(repeat num
(setq d1 (getreal "\nPlease enter the distance of point from A"))
*now on the next loop I need the next value to be assigned to d2 and so
forth around the loop.******
Now all the points that have been added can be worked upon
independantely
Thanks Jamie
mailto:[email protected]
==================================================================
And my reply to Jamie :
Jamie,
I think that you are aproaching the problem the wrong way. Instead
of trying to increment the variable name, why don't you just store all your
values in a list. You know how many you have, and in which order they are
entered, so it's a simple matter to retrieve them and do with them what you
wish. Here's a simple routine below :
(repeat num
);end repeat
(princ)
);defun
(princ)
;end coding here
All the values are stored, as a list, in the variable "thelist". To retrieve
them you could simply use the nth function. An even better way is to use a
"while" loop. This way you don't have to enter the number of downward
forces. You can enter as few, or as many as you like. Have a look at this :
(while
);end while
(princ)
);defun
(princ)
;end coding here
As soon as you press enter without entering a value, the routine will stop.
The number of entries will be stored in variable "num" and the values,
again, in the variable "thelist".
==================================================================
Loring Begay sent this tip for AutoCAD Release 14:
"Since AutoCAD R14 does not have the time in the status line like
R13, a DIESEL macro can remedy this. However, I use this utility
for today's date and current UCS status. This comes in handy
because most of my work involves extensive 3D modeling. This macro
also works with no ill effects in Mechanical Desktop.
Output:
Today is: Tuesday, 28 September, 1999, Darling. Current UCS:
LEFT
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
PRINCIPLES OF PROGRAMMING
All AutoLisp programs must contain the suffix LSP otherwise AutoCAD will not access them when
loading. (eg. CHTEXT.LSP).
Use a simple text processor such as Notepad to create and edit your lisp files.
Is a pre-defined set of instructions that describes a set of actions that AutoLisp is to perform, divided
into three sections :
● OPERATOR - Getting input.
● ARGUMENT - Manipulating the input.
● COMMAND - Using the manipulated input.
CHARTING
Draw out or write out in English what you want your program to do.
VARIABLES
These are like empty boxes in which to store data, to be used later. In AutoLisp, variables may be a
collection of letters or numbers as long as they begin with the letters.
Example of legal variables are as follows :
● A
● ARC1
● POINT1
● PNT1
● D3
An AutoLisp variable may contain more than one value in a single variable. A value can be anything,
such as :
● Real number
● String
● Integer
● Pickset
Therefore a variable can store just about anything.
STRUCTURING
Structure your program in such a way that it is easy to understand, by yourself and everyone else. e.g.
Keep input statements together. Keep your arguments together. Keep your commands together. Track
From where the semicolon begins, the remainder of the line is a comment statement.
PARENTHESES ( )
Parentheses are vital to writing AutoLisp programs. All commands are surrounded by parentheses.
AutoLisp uses parentheses to nest, allowing you to write a command that acts on (evaluates) another
command. In turn, that command can act on another. As you add parentheses, you're nesting
commands become deeper and deeper. Remember to come out of the nest with an equal number of
parentheses.
In AutoLisp the name of the program or function must be defined in the first statement, which is done
by using the command
DEFUN.
Defun is the first actual command and is followed by the name of the function (or program). There are
different ways of starting a function for example :
● (Defun drawline ()
● (Defun drawline (/ pntl pnt2)
● (Defun C:drawline ()
● (Defun C:drawline (/ pntl pnt2)
● (Defun drawline (a / pntl pnt2)
The first way, you are saying that all variables you plan to use in the program are GLOBAL, which are
variables that do not lose their value after the program ends.
The second way, you are saying that the variables you are using are LOCAL variables, which are
variables that have value only for that program and while that program is running.
The third way, as the first BUT the C: tells AutoCAD to treat that function as any other AutoCAD
command.
The last, variable a receives the first value to it from outside the program.
DATA TYPES
Integers - Is a number ranging between -32768 and +32767 without decimal points eg: 1
Reals - Is a number with a decimal point eg: 1.0
Lists - A list is a variable that has more than one element. A point in your drawing is described by the
value of the X co-ordinate and the value of the Y co-ordinate. In AutoLisp, that point can be described by
a single variable, a list of two elements, the first being the X value and the second being the Y value eg :
● ( 7 10 )
● (5972)
● (1.5 2.3 4.9 )
2. (getint "\Enter your age :") Type a number and AutoLisp will return that number.
3. (getreal "\nEnter a number:") Type a real number eg 10.51 and AutoLisp will return that number.
4. (getcorner pntl "\n Pick second point:") Will create an elastic window from variable pntl.
5. (getstring 1 "\What is the day today ?:") Type some text and Autolisp will return that text.
6. (getdist "\nHow long is the line ?:") Pick two points or type a length and AutoLisp will return that
length.
7. (getangle "\nWhat is the angle ?:") Pick two points for the angle or type an angle and AutoLisp will
return that angle in radians.
(getkword "\nAre you going? ("Yes or NO):") Initget will control the next getxxx function, getkword will
accept only one word. The initget will accept that one word only to be Yes or No.
Initget Bits
● 1 Disallow null input
● 2 Disallow zero values
● 4 Disallow negative values
● 8 DO not check limits, even if LIMECHECK is on.
● 16 Return 3D points rather than 2D points.
● 32 Use dashed lines when drawing rubber band or box.
(initget (+ 1 2 4))
(getint "\nHow old are you?:") Will only accept an Integer eg : 21
● 11. (getorient "\nWhat is the angle?:") Pick two points for the angle or type an angle and AutoLisp
will return an angle in radians relative to 0 degrees at East.
(Setq) is an assignment command, eg : it assigns the value of one variable or constant to another
variable.
NOTE : (Setq) is the primary assignment command in AutoLisp. The = is not used as an assignment. =
does exist but only as a non assignment statement. It does not have the ability to make one variable
equal to another. (It is used for a comparison of variables, numbers or strings)
(setq a b)
NOTE : The first variable after the (setq) is the one that receives the value.
Print Commands
Prompt
(terpri)
This is a line feed that causes the next printed text to appear on the next line. It generally follows the
prompt command. eg:
● (prompt "Hello, how are you ?")(terpri) or
● (prompt "\nHello, how are you ?")
Prin1
This function prints the expression on the screen and returns the expression. It can be any expression
and need not only be a string. The expression can also be written to a file and will appear in the file
exactly as it would on the screen.
● (prin1 "Hello") would print Hello
● (prin1 a) would print the value of variable a
● (prin1 a f) would print the value of variable a to an open file named in variable f
Princ
Is the same as prinl except that the control characters ("") are not printed. Can also be used to print a
blank line by using no statement after princ.
Same as prinl except that a new line is printed before the expression and a space is printed after the
expression. eg:
● (print "Hello") would return "Hello" "Hello"
Setvar
This function sets an AutoCAD system variable to a given value and returns that value. The variable
name must be in double quotes. eg:
● (setvar "blipmode" 0) returns 0
Polar
This function returns the point at an angle (in radians) and distance from a point.
● (polar pntl angl distl)
Inters
Examines two lines and returns the point where they intersect even if they do not cross one another.
● (inters pntl pnt2 pnt3 pnt4)
Any AutoCAD command can be used inside your lisp program BUT one must remember that they have
to be used exactly as you would in AutoCAD and your RETURN is a double set of Quotes (""). eg:
(command "line" pnt1 pnt2 "") This will draw a line from pntl to pnt2 and the "" acts as a return to
terminate your line command.
(graphscr) would return you to the graphics screen while the program is running.
When you used (setq a (getpoint)) you assigned the X and Y coordinate numbers to variable a. That
Variable now is a list that may look like (5 10). If you want to look at the list in variable a, AutoLISP gives
you a convenient way to do that from the command line.
!a Placing the ! in front of the variable will display the value or values of the variable.
The primary command for taking a list apart, (car) gives you the first element of the list. If the value of a
is a list of: (5 10)
Then (setq b (car a)) would assign to the variable b the value of the first element in a which is 5.
This is the secondary command for taking a list apart. (cdr) gives you the second and remaining
elements of the list. If variable a is a list of
(2 5 7 9 11)
Then (setq b (cdr a)) would assign to variable b the second and remaining elements of the list in variable
a
(5 7 9 11).
This always produces the second element of a list. Assuming a still has the list (5 10),
This always produces the third element of a list. Assuming a has a list (3 7 5)
(princ)
)
DTR converts degrees to radians.
(* pi (/ a 180)) )
RTD converts radians to degrees.
(/ (* a 180) pi) )
Things to strings
(strcase a) returns the alphabetic characters in variable a from lower case to upper case.
List Manipulation
The apostrophe ' serves a special function in AutoLISP, for example if a group of items is preceded by
an apostrophe ' it is treated as a list. eg:
Angle
Returns an angle between two points in radians. To use that angle in AutoCAD you have to convert it
back to decimal degrees. eg:
(setq a (angle pntl pnt2)) sets the angle between pntl and pnt2 to the variable a.
To use a:
(command "text" pntl "40" a t) The text command with a height of 40, rotation angle assigned to variable
a and text to variable t. But a is not the correct rotation angle because it is in radians.
Append
Takes any number of specified lists and joins them together as one list. eg:
(append '(10 20) '(30 40)) returns the list: (10 20 30 40).
(append a b) returns the list in variable a and the list in variable b as one.
Distance
(setq distl (distance pntl pnt2)) returns the distance between pntl and pnt2 and assigns the distance to a
variable called dist1.
Length
Looks for a duplicate and returns that and the rest of the list eg:
Returns the nth element in a list, where n is the number of the element to return. (Zero is the first
element). eg:
Assoc (associative)
Often used with (subst) command, this command lets you search for a specific element, then assign
that element to a variable.
Lets assume variable b is the list ((10 5.5 2.7)(40 5)) and you looking for a code 40. You want to pull out
the entire element and assign it to a variable c. eg:
This assigns the entire element containing the 40 in the list b to variable c. Now c is
Subst (subsitute)
Allows you to substitute one aspect for another. When substituting ALWAYS substitute the new item for
the old in the list. Now lets substitute 20 for the 5 in the variable c.
'(40 20) is the new element substituted for the old element (40 5) c, found in list b.
(setq bl (subst '(40 h) c b)), It looks like it should work, but it does not. The new element will look like
this: (40 h).
(subst) cannot interpret variables. You need to construct a new variable containing the entire list
element, then use
Cons (Construct)
Constructs a new list with the new element placed at the begining. Assume variable c contains the
following list: (40 5).
(setq d (cons (car c) h)) Remember (car c) gives you 40. Therefore, (car c) is the new first element,
followed by the value h. Thus it produces a new list d (40 20.0).
Now we substitute:
(setq bl (subst d c b)) That substitutes the new element found in variable d for the old element found in
variable c. (In the list found in variable b) and assigns the new list to bl.
Conversions
Angtos
Takes an angle in radians and converts it into a string, into a specific format.
(fix 8) returns 8
This function returns the convention of an Integer to a real number. (One can use either real or an
Integer.) eg:
Ascii
Returns the convention of the first character of a string into its ASCII character code. (An Integer) eg:
Returns the convention of an Integer representing an ASCII character code into a single character
string. eg:
Atof
specified format.
The real number can be set according to mode and precision. eg:
Conditionals
(=)
Is not an assignment command, only (setq) is. The (=) command is used only to test if items are equal. It
does not make them equal.
if
(if) is the standard if-then-else statement. In AutoLISP you may only match one if statement with a then
statement. eg:
Cond (Conditional)
This function accepts any number of lists as arguments. It evaluates the first item in each list (in order
supplied) until one of these items are a value other than nil.
(cond
((= s "Y") 1)
((= s "y") 1)
((= s "N") 0)
((= s "n") 0)
(t nil)
This function tests the response and returns 1 if it is "Y" or "y", and 0 if it is "N" or "n", and nil
otherwise.
Repeat
Similar to a loop but repeat will only go through the commands as many times as is told. eg:
(setq a 10)
(setq b 100)
(repeat 4
(setq a (+ a 10))
(setq b (+ b 10))
Returns 140.
While
Is another loop control command available in AutoLISP. A loop is necessary if you want to repeat a
command. However, unless you have a way of controlling it, the program will run forever and hang you
up. eg:
(setq a "w")
(while a
The loop will continue, begining with the commands that follow, until the variable a is set to nil.
(xxxx)
Evaluates if c is equal to d, and if so, sets the loop controlling variable a to nil to end the loop.
While parenthesis closes loop, and program will continue with the commands after this.
Entities
An entity is the smallest object you can place on your screen. The following are entities: LINE, CIRCLE,
ARC, TEXT, POLYLINES, etc. Entities are stored and referenced in the drawing database. They can be
changed and manipulated using AutoLISP to suit your needs. Each entity has a massive definition in
AutoCAD's database. eg: The data for a single line contains the following info:
Entity name, Entity type, Layer, Color, Beginning X Y coordinate, Ending X Y coordinate, Line type, etc.
You can modify any of the above aspects. An example of an entity list:
( - 1 <Entity name: 60000014) (0 "CIRCLE") (8 . "LAYER1")
It is an entity list of a circle on layer LAYER1, center point relative to 0,0 of 50.0,100.0 , and a radius of
60.0
Both give you a way of selecting the entities for the selection set. (entsel) only selects one entity at a
time. You may not use WINDOW or CROSSING to select entities. (ssget) however lets use WINDOW or
CROSSING as well as other selection techniques. You will mostly be using (ssget).
(setq a (ssget)) will prompt you to select objects. You have now created a selection set with a specific
name, <Selection set:l> , assigned to variable a, or use filter option (setq a (ssget "X" '((0 . "TEXT")))) to
search database for certain entities or codes.
Lets you secure the name of the entity. The name of the entity is realy a hexadecimal number, therefore
don't expect to see a name like LINE, or CIRCLE etc. The name of your entity might be 60000018.
Lets assume variable a is the selection set and variable i is set to 0. (setq i 0) To set Counter variable.
(setq na (ssname a i)) This assigns na the entity name found in the selection set a at index number i.
Remember that a selection set may contain more than one entity name. You can point to each entity by
using its relative number in the selection set. eg: Entity 1 is Index 0 , Entity 2 is Index 1 , etc.
This command actually pulls out, or extracts, the entity list. The entity list can be assigned to a variable.
(setq b (entget na)) That assigns to b the entire entity list for that entity name.
Allows you to substitute one aspect for another. Assume variable b is the name of the list and variable c
contains the value of the element: (40 . 60.0000) (setq bl (subst '(40 . 30.0000) c b)) ;bl is now the new
list. '(40 . 30.0000) is the new element substituted for the old element c found in list b.
Sslength
Gives you the ability to take the newly modified entity list and write it back to the database to update the
drawing. Now that you have a new list in the variable b1, you want to make bl the permanent list in your
drawing database. (entmod bl) You should see the change appear on the screen.
This program permits you to draw lines perpendicular to other lines. The program measures the angle
of the line chosen, and shifts the SNAP ANGLE to the angle of that line. Use ORTHO ON and draw
perpendicular to your chosen line.
(graphscr)
(setq a (entsel))
(princ)
(defun c:perpdoff
(setvar "snapang" 0)
(princ)
)
Erase Screen
Erases everything on the drawing screen. If you are in a ZOOM ALL position, the program erases
everything within the limits of the drawing.
Note: if you accidentally invoke this command, you can recover with OOPS.
(defun c:erasescr (/ l u)
(princ)
Change Layer
Lets you select objects by any selection method and change their layer. The target layer is chosen by
simply pointing to an object on the desired layer. All objects selected will then change to that target
layer. To test this program, you will need to create a drawing with objects on different layers.
(defun c:chlayer (/ a1 a2 n index b1 b2 d1 d2 b3)
(graphscr)
(setq a1 (ssget))
(setq a2 (entsel))
(setq index 0)
(repeat n
(entmod b3)
(princ)
(graphscr)
(setq a1 (ssget))
Allows you to select the objects to be changed. The selection set is assigned to variable al.
(setq a2 (entsel))
This is a special type of selection statement that allows you to select only one entity.
(setq index 0)
This looks for the code 8 in entity list a2, then assigns the sublist to d2.
(repeat n
This begins the loop that pages through the selection set.
Substitutes the new d2 layer for the old d1 layer in the entity list a1, and assigns it to the new entity list
b3.
(entmod b3)
Increases the index variable by 1, making it ready for the next loop.
The first ) closes the repeat loop. (princ) exits quitly. The second ) closes the function.
Substitute text
This program lets you choose a line of text and substitute another line at exactly the same place.
(defun c:subtext (/ a b d e d1 b1 y)
(setq a (entsel))
(entmod b1)
(setq y (getstring "\nIs this correct - Y : "))
(princ)
This program lets you change the distance between multiple text lines. In addition to the standard start
point and height, you are asked to enter the distance between text lines. You may enter as many text
lines as you wish. To stop the program, enter an asterix (*).
(defun tex (/ p1 a b c d e f)
(setq d "T")
(while d
(setq f (getstring))
(princ)
(setq a (ssget))
(setq index 0)
(repeat n
(progn
(entmod b2))))
(princ)
)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Let's start up with something very simple and that will give you immediate results. Fire up
AutoCad and type this at the command prompt:
(alert "Yebo Gogo")
Now press enter. This should appear on your screen :
(setq a (getpoint))
Means, in plain English :
Get a point from the user and store the x, y and z
values as a list in variable "a".
Did you notice how everything is enclosed within parenthesis?
All AutoLisp functions are surrounded by parenthesis.
As well, AutoLisp allows you to "nest" your functions.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(defun testline ()
;define the function
) ;end defun
Now, save this file as "testline.lsp" remembering, to save it as a ASCII Text file and ensuring that it
is saved in a directory in your AutoCAD's search path. Now open AutoCAD and type this :
(load "testline")
This will load the function into memory. (Did you notice that you do not have to stipulate the "lsp"
extension?) Now type this :
(testline)
Your function should now run.
Let's edit this routine so that it acts like a standard AutoCAD command :
(defun c:testline ()
;define the function
) ;end defun
(load "testline")
testline
Much better, Hey.
We do have one problem though. Did you notice that when we loaded the routine, an annoying
"nil" kept on popping up. We also got the same "nil" returned to us when we ran the routine. To
suppress this "nil" when loading or
running, we can use the (princ) function. Here's what your routine would look like :
(defun c:testline ()
;define the function
(princ)
;clean running
) ;end defun
(princ)
;clean loading
For more details on the (defun) function, refer to The AfraLisp Tutorial :
Define Function (defun).
And for a more detailed expanation of loading AutoLisp routines, refer to the AfraLisp tutorial :
Loading AutoLisp Files.
The values that we need to retrieve from the user are as follows :
Insertion Point ip
Length of Beam lb
Height of Beam hb
Flange Thickness wt
End Plate Thickness ep
Length of Notch nl
Depth of Notch nd
Let's write a routine to retrieve these values first.
(defun c:testbeam ()
;define the function
;********************************************************
;Get User Inputs
;********************************************************
(princ)
;finish cleanly
) ;end of defun
;**********************************************************
(princ) ;load cleanly
;**********************************************************
Load and run the routine. You will be prompted for all the values listed above. Enter some
numbers and then check the value of all the variables by preceeding the value names with "!" (e.g.
!ip).
O.K. we've got all the values we need from the user.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Well, as you can see, we have quite a few points that we need to calculate.
Fortunately, AutoLisp has a function to help us, the (polar) function.
The (polar) function works like this :
You pass it a point, an angle and a distance and (polar) will return a second point at the specified
angle and distance from the first point.
But, we have one problem. All angles in AutoLisp MUST be given in radians.
Let's quickly write a function to do that. Add this function to your Testbeam.lsp file :
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
) ;end of function
O.K. thats our "degrees to radians" function taken care of.
Now we'll have a look at the (polar) function in action.
(defun c:testbeam ()
;********************************************************
;Get User Inputs
;********************************************************
;**********************************************************
(princ)
;finish cleanly
) ;end of defun
;**********************************************************
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
) ;end of function
;**********************************************************
(princ) ;load cleanly
;**********************************************************
Right, now that we've calculated all the points required to draw the beam, let us add a (command)
function to do this task for us.
(defun c:testbeam ()
;define the function
;********************************************************
;********************************************************
;Start of Polar Calculations
;*********************************************************
(princ)
;finish cleanly
) ;end of defun
;**********************************************************
;This function converts Degrees to Radians.
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
) ;end of function
;**********************************************************
(princ) ;load cleanly
;**********************************************************
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(defun c:testbeam ()
;define the function
;********************************************************
;********************************************************
;Switch OFF System Variables
(setvar "osmode" 0)
;Switch OFF snap
(setvar "blipmode" 0)
;Switch OFF Blipmode
;********************************************************
;Get User Inputs
(setvar "osmode" 0)
;switch OFF snap
;********************************************************
;Start of Polar Calculations
;*********************************************************
) ;end of defun
;**********************************************************
;This function converts Degrees to Radians.
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
) ;end of function
;**********************************************************
(princ) ;load cleanly
;**********************************************************
Load and run the program. If you were having problems, they should now have disappeared. (I
hope!!). Did you notice how we switched on the snap just before asking for the insertion point?
This, of course, is to allow the user to snap to an insertion point.
We still have another problem though. What would happen if the user entered an illegal value, such
as zero, or a negative number.
This could cause very strange results.
To guard against this we will use the (initget) function.
Here's how it works :
(initget (+ 1 2 4))
(setq lb (getdist "\nLength of Beam : "))
This function works on the "sum of the bits" system.
(initget 7)
(setq lb (getdist "\nLength of Beam : "))
Let's add this function to our routine :
(defun c:testbeam ()
;define the function
;********************************************************
;Save System Variables
(setvar "osmode" 0)
;Switch OFF snap
(setvar "blipmode" 0)
;Switch OFF Blipmode
;********************************************************
;Get User Inputs
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
;********************************************************
;Start of Polar Calculations
;*********************************************************
(princ)
;finish cleanly
) ;end of defun
;**********************************************************
;This function converts Degrees to Radians.
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
;**********************************************************
(princ) ;load cleanly
;**********************************************************
(defun c:testbeam ()
;define the function
;********************************************************
;Save System Variables
;********************************************************
;Switch OFF System Variables
(setvar "osmode" 0)
;Switch OFF snap
(setvar "blipmode" 0)
;Switch OFF Blipmode
;********************************************************
;Get User Inputs
(initget (+ 1 2 4))
;check user input
(setq lb (getdist "\nLength of Beam : "))
;get the length of the beam
(initget (+ 1 2 4))
;check user input
(setq hb (getdist "\nHeight of Beam : "))
;get the height of the beam
(initget (+ 1 2 4))
;check user input
(setq wt (getdist "\nFlange Thickness : "))
;get the thickness of the flange
(initget (+ 1 2 4))
;check user input
(setq ep (getdist "\nEnd Plate Thickness : "))
;get the thickness of the end plate
(initget (+ 1 2 4))
;check user input
(initget (+ 1 2 4))
;check user input
(setq nd (getdist "\nDepth of Notch : "))
;get the depth of the notch
(while
;start of while loop
(setvar "osmode" 0)
;switch OFF snap
;********************************************************
;Start of Polar Calculations
;**********************************************************
;Reset System Variable
;*********************************************************
(princ)
;finish cleanly
) ;end of defun
;**********************************************************
;This function converts Degrees to Radians.
(* pi (/ x 180.0))
;divide the angle by 180 then
;multiply the result by the constant PI
) ;end of function
;**********************************************************
(princ) ;load cleanly
;**********************************************************
The programme will now repeat itself indefinetly, asking for an insertion point and drawing a
beam, until the user presses enter.
This is how it works. The (while) function will continue to evaluate an expression until the
expression evaluates to nil. As long as the user selects a point, the expression is true. But, when the
user selects "Enter" the expression returns "nil" and the programme moves out of the loop.
(AutoLisp evaluates "Enter" as "nil")
I hope you have understood this tutorial and that it has given you a better understanding of
AutoLisp. You will find a more detailed explanation of many of the functions used here in other
tutorials on this site.
If you would like the source coding for this AutoLisp Tutorial
then Click Here. Cheers for Now......
Page I. Page II. Page III. Home.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
You do realise that the name of the AutoLISP file, is not necessarily the name of the program. In
fact, one AutoLISP file can have several programs inside.
Hey, that was easy, I hear you say. Now comes the hard part!!
After you've named your program you have three choices.
First, do nothing by using ( ) :
(defun DDSTEEL ( )
What you are saying here is that every variable that you use in your function is GLOBAL. A
GLOBAL variable is one that doesn't lose it's value when the program ends. For example, if PT3
was defined as 45.2 in your program, it would still have the value of 45.2 when your program ends
and would retain that value until you replace it with another value or, start a new drawing.
Secondly, you can declare your variables as LOCAL.
To do this you precede your variables with / :
(defun DDSTEEL ( / p1 p2 p3)
You will find that they still have the values of 45.0. and 90.0 respectively.
A LOCAL variable is one that has a value only for that program while the program is running.
The third option is to list a variable without the /.
This means that a variable is set up to receive a value passed to it from outside the program. eg :
(defun DTR (a)
(* PI (/a 180.0))
)
To use this, we must pass the value of the argument to the function :
(DTR 90.0)
(setq a (* (* r r) PI))
(princ)
)
Now try it :
Command: (load "acirc")
Command: (acirc 24)
DDSTEEL is the name of the function. Variable a is an argument and receives the first value passed
to it from outside the program.
Variables b, c, and d are all locals and lose their values once the program has ended.
Another option that can be used with (defun is if the name of the function is preceded with C:
(defun C:DDSTEEL ()
Because of the C: you don't have to use parenthesis to call the function.
AutoCAD now thinks of that function as an AutoCAD command.
This is only true if you call the function from the AutoCAD command line.
If you call the function from within another function you must precede it with C:
(C:DDSTEEL)
It's a good idea to leave all variables as global whilst you are writing your
program so that you can check their values during debugging.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
One of the most important things to remember about loading AutoLisp Routines is to ensure that
your Lisp files and any support files (i.e DCL Files; DAT Files; etc) are in your AutoCad search
path. (I dedicate a directory to all my Lisp files and relevant support files.
Toolbars :
***TOOLBARS
**STEEL
TB_DDSTEEL [_Button("Steel", "STEEL.bmp", "STEEL32.bmp")]^C^C^P+
(cond ((null C:ddsteel) (prompt "Please Wait...")(load "ddsteel"))) ddsteel
This method of loading Lisp files first checks to see if the routine is already loaded. If it is, it runs
the routine. If it is not, it first loads the routine, then runs it. Clever Hey...
Acad.Lsp File.
The Acad.Lsp file is a useful way of loading a library of AutoLisp routines.
Each time you start a drawing AutoCad searches the library path for an Acad.Lsp file. If it finds
one, it loads the file into memory.
You could use the normal load function (load "filename") in your Acad.Lsp file but if an error
occurs whilst attempting to load one of your routines, the remainder of the file is ignored and is not
loaded.
Therefore, you must use the on failure argument with the load function :
(load "Lispfile1" "\nLispfile1 not loaded")
(load "Lispfile2" "\nLispfile2 not loaded")
(load "Lispfile3" "\nLispfile3 not loaded")
This would automatically load the commands Utils1, Utils2 and Utils3 from the Utils.Lsp file and
DDSteel from the DDSteel.Lsp file.
S::Startup Function.
If the user defined function S::Startup is included in the Acad.lsp or a .MNL file,
it is called when you enter a new drawing or open an existing drawing.
e.g. Say that you wanted to override the standard AutoCad LINE and COPY commands with
versions of your own, your Acad.Lsp file would something like this :
(defun C:LINE ()
.....Your Definition.....
)
(defun C:COPY ()
.....Your Definition.....
)
(defun S::Startup ()
(command "Undefine" "LINE")
(command "Undefine" "COPY")
)
Before the drawing is initialised, new definitions for LINE and COPY are defined. After the
drawing is initialised, the S::Startup function is called and the standard definitions of LINE and
COPY are undefined.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(~ <NUMBER>)
(1+ <NUMBER>)
(abs <NUMBER>)
(angtos <ANGLE>[<MODE><PRECIS.>])
2=Grads,3=Radians,4=Surveyor
(ascii <STRING>)
Returns ascii value of first character of a string.
(assoc <ITEM><ALIST>)
(atof <STRING>)
(atoi <STRING>)
(atom <ITEM>)
(boundp <ATOM>)
(car <LIST>)
(caar <LIST>)
(cadar <LIST>)
(cadr <LIST>)
(caddr <LIST>)
(cdar <LIST>)
(cddr <LIST>)
(chr <NUMBER>)
(close <FILENAME>)
Closes a file.
(command <ARGS>...)
(cos <ANGLE>)
(entnext [<ENAME>])
(entlast)
(entsel [<PROMPT>])
(entdel <ENAME>)
(entget <ENAME>)
(entmod <ENAME>)
(entupd <ENAME>)
(eval <EXPR>)
Evalutes an expression.
(exp <NUMBER>)
(findfile <FILENAME>)
(fix <NUMBER>)
(float <NUMBER>)
(foreach <NAME><LIST><EXPR>)
(getangle [<PT>][<PROMPT>])
(getcorner [<PT>][<PROMPT>])
(getenv [<VARIABLE>])
(getkword [<PROMPT>])
(getorient [<PT>][<PROMPT>])
(getpoint [<PT>][<PROMPT>])
(getreal [<PROMPT>])
(getstring [<CR>][<PROMPT>])
(graphscr)
(grclear)
(grdraw <from><to><color>[<highlight>])
(grtext <box><text><highlight>])
(grread <track>)
(if <testexpr><thenexpr>[<elseexpr>])
(inters <pt1><pt2><pt3><pt4>[<onseg>])
(itoa <number>)
(lambda <arguments><expr>...)
(last <list>)
Returns the last element in <LIST>.
(length <list>)
Returns the number of elements in <LIST>.
(list <expr>)
(listp <list>)
(load <filename>)
(log <number>)
(logand <number><number>...)
(logior <number><number>...)
by <NUMBITS>
(mapcar <function><list1>...<listn>)
through <LIST2>.
(max <number><number>...)
(member <expr><list>)
(menucmd <string>)
Switch between pages in an AutoCAD menu.
(min <NUMBER><NUMBER>...)
(minusp <ITEM>)
(not <ITEM>)
(nth <n><LIST>)
(null <ITEM>)
(numberp <ITEM>)
Returns T if <ITEM> is an integer or a real.
(open <FILENAME><MODE>)
Opens a file.
(or <EXPR>...)
(osnap <PT><MODE-STRING>)
(polor <PT><ANGLE><DISTANCE>)
(prin1 <EXPR>[<FILENAME>])
(princ <EXPR>[<FILENAME>])
without expansion.
(print <EXPR>[<FILENAME>])
(progn <EXPR>...)
(prompt <MSG>)
(quote <EXPR>)
(read <STRING>)
(read-char [<FILENAME>])
(read-line [<FILENAME>])
(redraw [<ENAME>][<MODE>])
(reverse <LIST>)
(set <SYM><EXPR>)
(setq <SYM1><EXPR1>...)
(setvar <VARNAME><VALUE>)
(sin <ANGLE>)
(ssget [<MODE>][<PT1><PT2>])
(ssname <SS><INDEX>)
(ssadd [<ENAME>][<SS>])
(ssdel [<ENAME>][<SS>])
(ssmemb [<ENAME>][<SS>])
(strcase <STRING>[<WHICH>)]
(strcat <STRING1><STRING2>..)
(strlen <STRING>)
(subst <NEWITEM><OLDITEM><LIST>)
(substr <STRING><START><LENGTH>)
of <LENGTH> characters.
(terpri)
(textscr)
(trace <FUNCTIONS>...)
(trans <PT><FROM><TO>[<DISP>])
(type <ITEM>)
(untrace <FUNCTIONS>...)
(ver)
(vports)
(while <TESTEXPR><EXPR>)
(vmon)
(*error* <STRING>)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
DISCLAIMER: This document is a compilation of information from dozens of sources. For all intents
and purposes, consider all of the enclosed information to be copyrighted by the individual authors.
They retain full copyright protection. This document is presented “as is” although every effort has been
made to insure accuracy.
R. B. “Andy” Anderson
2744 Botts Landing Road, #1103
Deland, Florida 32720-8953
[email protected]
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Remember that environment variables are dependent on .. well, the environment, so each may or may
not apply to a certain setup.
Some are almost described, some are definitely not. The first are OS dependent, the rest are AutoCAD
dependent.
System related
(getenv "Path") ;string System search paths
General
(getenv "ACAD") ;string Support search paths
(getenv "acet-Enable");string
(getenv "Pickstyle");integer
(getenv "ShowProxyDialog");integer
(getenv "EdgeMode");integer
(getenv "PAPERUPDATE");integer
(getenv "ImageHighlight");integer
(getenv "Dragmode");integer
(getenv "UseMRUConfig");integer
(getenv "PLSPOOLALERT");integer
(getenv "PLOTLEGACY");integer
(getenv "PSTYLEPOLICY");integer
(getenv "OLEQUALITY");integer
(getenv "LineWeightUnits");integer
(getenv "CustomColors");integer
(getenv "Blipmode");integer
(getenv "ToolTips");string
1) used by MEASUREINIT and MEASUREMENT sysvars
Editor Configuration
(getenv "SDF_AttributeExtractTemplateFile");string ??
(getenv "AutoSnapSize");integer
(getenv "FontMappingFile");string
(getenv "LogFilePath");string
(getenv "PSOUT_PrologFileName");string
(getenv "MainDictionary");string
(getenv "CustomDictionary");string
(getenv "MTextEditor");string
(getenv "XrefLoadPath");string
(getenv "SaveFilePath");string
(getenv "AcadLspAsDoc");string
(getenv "MonoVectors");integer
(getenv "FontHeight");integer
(getenv "FontWeight");integer
(getenv "FontItalic");integer
(getenv "FontPitchAndFamily");integer
(getenv "CursorSize");integer
(getenv "CmdLine.BackColor");integer
(getenv "TextWindow.ForeColor");integert
(getenv "TextWindow.BackColor");integer
(getenv "CmdLine.FontFace");string
(getenv "CmdLine.FontHeight");integer
(getenv "CmdLine.FontWeight");integer
(getenv "CmdLine.FontItalic");integer
(getenv "CmdLine.FontPitchAndFamily");integer
(getenv "TextWindow.FontFace");string
(getenv "TextWindow.FontHeight");integer
(getenv "TextWindow.FontWeight");integer
(getenv "TextWindow.FontItalic");integer
(getenv "TextWindow.FontPitchAndFamily");integer
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
3 Create a subdirectory called Express under the directory you installed AutoCAD 2002. For example if
you installed AutoCAD on the C:\ drive in the directory C:\Program Files\AutoCAD 2002, create the
directory C:\Program Files\AutoCAD 2002\Express.
4 Copy all of the Express Tools files from Express\*.* backed up in Step 1 into this new directory you
created in Step 3.
5 Copy acettest.fas to the AutoCAD 2002 Support Files subdirectory. Following the example above, if
you have installed AutoCAD on the C:\ drive in the C:\Program Files\AutoCAD 2002 directory, the
Support files directory would be C:\Program Files\AutoCAD 2002\Support.
6 Copy acetmain.hlp, acetmain.cnt, acetfaq.hlp to the AutoCAD 2002 Help subdirectory. Again, following
the example directories above, the help directory would be C:\Program Files\AutoCAD 2002\Help.
7 At the command line, enter the EXPRESSMENU command by typing EXPRESSMENU at the command
line.
The Express Tools menu will now load automatically in AutoCAD 2002 and
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Instructions :
Unzip the acetmain.mnu file contained in the zip file into the AutoCAD Express directory
containing the default Express Tools menu. This can normally be found within a directory
path that looks something like this :
C:/Program Files/Autocad 2002/Express
If you open AutoCAD and look under "Tools" - "Options" - "Files" - "Support File Search
Path", you will also find the Express directory listed there :
http://www.contractcaddgroup.com/download/ExpressBonusTools.zip
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Instructions :
Unzip the acetmain.mnu file contained in the zip
file into the AutoCAD Support directory containing
the default Express Tools menu. This can
normally be found within a directory path that
looks something like this :
c:/documents and settings/username/application data/autodesk/autocad 2004/R16.0/enu/support/
The username folder will, of course, change to suit your set up.
If you open AutoCAD and look under "Tools" - "Options" - "Files" - "Support File Search
Path", you will also find the AutoCAD support directory listed there :
Note!!
As we now want to force the Express Tools menu to recompile, you now need to delete
the following two files from the same directory as the menu file :
acetmain.mns and
acetmain.mnc
Now restart AutoCAD.
The Express Tools Menu will recompile and you will find that all the Command Line
functions have been added to the Express Tools pull down menu.
http://www.contractcaddgroup.com/download/ExpressBonusTools.zip
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
In the Start In box, enter the path of the folder that should be the default when you open or save drawing
files.
Choose OK.
REMEMBERFOLDERS
Type: Integer
Saved in: Registry
Initial value: 1
Controls the default path for the Look In or Save In option in standard file selection dialog boxes.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Following code has a nested DEFUN in it. This technique is used to avoid
passing around variables to different routines. Everything in the nested
subroutine CreateMenu gets executed if the pulldown menu we are
looking for doesn't exist. Of course, it could be placed within a lengthy PROGN statement at the end
of the test, but this way the code does a much more obvious branching.
Notice that our new menufile isn't actually loaded before we make sure that it isn't already loaded.
Because AutoCAD deals with standard Windows issues when setting up menus, strange things can
happen if we force a multiple load of the same menu.
(defun C:VBATOOLBARMENU (/ fn acadobj thisdoc menus flag currMenuGroup newMenu
newMenuItem openMacro
)
;; CreateMenu is a nested DEFUN that is executed if our "VbaMenu"
;; pulldown menu doesn't exist. A test for the presence of this
;; pulldown menu is done in the main code
(defun createMenu ()
;; Add a new popUpMenu to currMenuGroup, i.e. to "VbaMenu"
Now navigate your way to VbaMenu.mns and open it. You should see something like this :
//
// AutoCAD menu file - D:\drawings\VbaMenu.mns
//
***MENUGROUP=VbaMenu
***POP2
ID_mnuVBA Menu [V&BA Menu]
ID_VBA Load [VBA &Load]^C^C_vbaload
ID_VBA Editor [VBA &Editor]^C^C_vbaide
ID_VBA Macro [VBA &Macro]^C^C_vbarun
ID_VBA Manager [&VBA Manager]^C^C_vbaman
[--]
ID_Zoom [&Zoom]^C^C_zoom w
ID_View Point [View &Point]^C^C_(if (not c:ddvpoint) (load "ddvpoint") ddvpoint
ID_3D Objects [&3D Objects]^C^C_$I=image_3dobjects $I=*
ID_AfraLisp.com [&AfraLisp.com]^C^C_browser www.afralisp.com
***TOOLBARS
***HELPSTRINGS
ID_VIEW POINT [View Point]
ID_AFRALISP.COM [Go visit this awesome place, or else!]
ID_VBA MANAGER [Display the VBA Manager]
ID_VBA LOAD [Load a VBA Application]
ID_ZOOM [Zoom Window]
ID_VBA MACRO [Run a VBA Macro]
ID_3D OBJECTS [3D objects]
ID_VBA EDITOR [Switch to the VBA Editor]
//
// End of AutoCAD menu file - D:\drawings\Vbamenu.mns
//
You should also find VbaMenu.mnc and VbaMenu.mnr in the same folder. Even though the
VbaMenu.mns didn't exist when we started, Visual Lisp has created it as well as all the coding
necessary and compiled the other menu support files required for the menu to run.
On the next page, we'll have a look at creating Toolbar menu's.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Home. Page I.
(vl-load-com)
(princ)
***MENUGROUP=VbaToolbarMenu
***TOOLBARS
**VBA_MENU
ID_VBA_Menu_0 [_Toolbar("VBA Menu", _Floating, _Show, 168, 152, 1)]
ID_VBA_Load_0 [_Button("VBA Load", "VbaLoad.bmp", "VbaLoad.bmp")]^C^C_vbaload
ID_VBA_Editor_0 [_Button("VBA Editor", "Vbaide.bmp", "Vbaide.bmp")]^C^C_vbaide
ID_VBA_Macro_0 [_Button("VBA Macro", "Vbamacro.bmp", "Vbamacro.bmp")]^C^C_vbarun
ID_VBA_Manager_0 [_Button("VBA Manager", "Vbaman.bmp", "Vbaman.bmp")]^C^C_vbaman
***HELPSTRINGS
ID_VBA_MANAGER_0 [Disply the VBA Manager]
ID_VBA_LOAD_0 [Load a VBA Application]
ID_VBA_MACRO_0 [Run a VBA Macro]
ID_VBA_EDITOR_0 [Switch to the VBA Editor]
//
// End of AutoCAD menu file - D:\drawings\VbaToolbarMenu.mns
//
If you would like the source coding for both of these menu's, smile nicely at the screen and click here.
Home. Page I.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Table of Contents
● Overview
● AutoCAD Release 12
❍ Option 1: Custom hatch image tile menu and the HATCH command
❍ Option 2: Add patterns to existing acad.pat and work without icons
● AutoCAD Release 13
❍ Option 1: Custom hatch image tile menu and the HATCH command
❍ Option 2: Add patterns to existing acad.pat and work without icons
● AutoCAD Release 14
❍ Option 1: Custom hatch image tile menu and the HATCH command
❍ Option 2: Add patterns to existing acad.pat and work without icons
Overview
The ACAD slide-library is pre-compiled when shipped, which means that in order to add a custom pattern to it, the library has to be
recompiled. This option is not practical for most users. Users who define custom hatch patterns may encounter difficulties when trying to
access their patterns through the normal command sequence or through dialog boxes. This document discusses two other options for
adding and accessing custom hatch patterns in AutoCAD Releases 12, 13, and 14.
AutoCAD Release 12
This section explains two options for adding and selecting custom hatch patterns in AutoCAD R12.
Option 1: Custom hatch image tile menu and the HATCH command
To create a custom hatch pattern in R12, refer to the User's Guide, Chapter 18: "Linetypes and Hatch Patterns" in the section Creating
Hatch Patterns. You can make the following changes to the menu (.mnu) file:
1. Add the custom section immediately below the Hatch command in the Draw pop menu: [--]
[/HHatch...]^C^C_bhatch
[/MMyHatch...]^C^C$I=icon_myhatch $I=*
[--]
2. In the ***icon section of the same .mnu file, add the image tile menu:
***icon
**icon_myhatch
[MyHatch]
[cmj(myzag,MyZag)]^c^c_hatch myzag
If you have more than one slide image and want them to appear, list them at the end of this section.
3. Create a pattern (like the one shown below) and save it in a file named myzag.pat. Save the file in the \SUPPORT subdirectory.
*MYZAG, Staircase effect
0, 0,0, .15,.15, .15,-.15
90, .15,0, .15,.15, .15,-.15
4. Create a 3 x 2 unit polygon and boundary hatch it using the custom pattern by entering the name of your pattern in the field next
to the Pattern button in the dialog box.
5. Do a Zoom Extents and make a slide of this hatched polygon using the MSLIDE command. Repeat steps 4 and 5 for each pattern
and slide.
6. Make a slide library with all of the slides in it using the following commands: (This example shows a slide and slide library in the
\SUPPORT subdirectory.)
dir *.sld/b > cmj.txt
slidelib cmj < cmj.txt
7. Use the MENU command to load and compile the new .mnu file. Select the MyHatch option from the Draw pull-down menu. This
should bring up an image tile menu with slides in it. Selection can be made with either the image or the name in the list to the left
of the images.
This option uses the HATCH command and the selected pattern.
1. Add your custom hatch pattern definitions (like the one below) to the end of the existing acad.pat file.
*MYZAG, Staircase effect
0, 0,0, .15,.15, .15,-.15
2. Save the acad.pat file after adding your custom hatch pattern definitions.
You will get a text reference (with a blank box) in the image tile menu so you do not have to remember the hatch pattern names -
only what they look like.
This option works with the BHATCH command.
AutoCAD Release 13
This section explains two options for adding and selecting custom hatch patterns in AutoCAD R13.
Note: The menu syntax used in R13 is slightly different than it is in R12.
Option 1: Custom hatch image tile menu and the HATCH command
To create a custom hatch pattern in R13, refer to the Customization Guide, chapter 2: "Linetypes and Hatch Patterns" in the
section Creating Hatch Patterns. Make the following changes in the menu file (mnu):
1. Add the custom section below the Hatch title in the Draw pop menu in acadfull.mnu. Notice the -> and <- marks; these
indicate a nested menu. The new listing must follow the last line of the nested menu in order to appear after the Hatch
option. By inserting one line earlier in the code, MyHatch would appear in the sub-menu of the Hatch selection between
Bhatch and Psfill.
[->&Hatch]
ID_Bhatch [&Hatch...]^C^C_bhatch
[&MyHatch...]^C^C$I=image_myhatch $I=*
[--]
2. In the *** image section of the same .mnu file, add the image tile menu. This section is now labeled "image" instead of
"icon" (as it was in R12).
***image
**image_myhatch
[MyHatch]
[cmj(myzag,MyZag)]^C^C_hatch myzag
3. Create a pattern (like the one show below) and save it in a file named myzag.pat. in the \SUPPORT subdirectory. The
pattern syntax is identical to R12 and .pat files used in R12 also work in R13.
4. Create a 3 x 2 unit polygon and boundary hatch it with the custom pattern by entering the name of the custom pattern in
the field next to the Pattern button (while you are in the Boundary Hatch dialog box).
5. Do a Zoom Extents and make a slide of this hatched polygon using the MSLIDE command. Repeat steps 4 and 5 for
each custom pattern and slide.
6. Make a slide library using the following commands: (This example shows the slide and slide library are placed in the
\SUPPORT subdirectory.) Note that slides and slide libraries created in R12 are still usable in R13.
7. Load the new menu file (.mnu) using either the MENU or the MENULOAD commands. Select the MyHatch option from
the Draw pull-down menu to display an image tile menu with the slide(s) in it. Selection can be made with either the image
tile or the pattern name in the list to the left.
This option uses the HATCH command and the selected pattern.
1. Add the custom pattern definitions to the end of the existing acad.pat file.
2. Save the acad.pat file after adding your custom hatch pattern definitions.
You will get a text reference within a blank image in the Pattern list in the Boundary Hatch dialog box. As a result, you do not have
to remember the hatch pattern names - only what they look like.
AutoCAD Release 14
This section explains two options for adding and selecting custom hatch patterns in AutoCAD R14.
Note: The only change from R13 is the location of the HATCH command in the Draw pop menu definition. Slides
and slide libraries created in R12 or R13 can still be used in R14. The same custom .pat files you used in R12 and
R13 will also work in R14.
Option 1: Custom hatch image tile menu and the HATCH command
To create a custom hatch pattern in R14, refer to the online Customization Guide, chapter 2: "Linetypes and Hatch Patterns" in the
section titled Creating Hatch Patterns. Make the following changes in the menu (mnu) file:
1. Add the custom section immediately below the Hatch title in the Draw pop menu. The same code used in R13 is
functional here; only the surrounding code looks different.
[--]
ID_Bhatch [&Hatch...]^C^C_bhatch
[&MyHatch...]^C^C$I=image_myhatch $I=*
ID_Boundary [&Boundary...]^C^C_boundary
ID_Region [Regio&n]^C^C_region
[--]
2. In the *** image section of the same .mnu file, add the image tile menu. Once again, there is no change from the R13
code used here.
***image
**image_myhatch
[MyHatch]
[cmj(myzag,MyZag)]^C^C_hatch myzag
3. Create a pattern and save it in a file called myzag.pat in the \SUPPORT subdirectory.
4. Create a 3 x 2 unit polygon and boundary hatch it using the custom pattern. (Enter the name of your pattern in the field
next to the Pattern button when you are in the Boundary Hatch dialog box.)
5. Do a Zoom Extents and make a slide of this hatched polygon using the MSLIDE command. Repeat steps 4 and 5 for
each custom pattern and slide.
6. Make a slide library with all the slides in it using the following commands: (This example shows a slide and slide library
in the \SUPPORT subdirectory.)
7. Load the new .mnu using either the MENU or MENULOAD commands. Select the MyHatch option from the Draw
pull-down menu to display an image tile menu that contains the slide(s). You can select the slides by either using the
image tile or the pattern name in the list at the left.
This option uses the HATCH command and the selected hatch pattern.
1. Add the custom pattern definitions to the end of the existing acad.pat file.
You will get a text reference within a blank image in the Pattern list in the Boundary Hatch dialog box. You do not have to
remember the hatch pattern names - only what they look like.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Let's take a look at a simple hatch pattern first. The same principal applies to even the most
complicated hatch pattern so, as my Mum often says, "Pay attention!!"
A hatch pattern definition is stored in a simple ASCII text file with an extension of PAT. You can
append a hatch pattern to an existing file if you wish, or you can store it in it's own file. If you store
it in it's own file, the file name must match the name of the hatch pattern. We are going to create
our own hatch definition or pattern file.
O.K. Open Notepad and add this line :
*Dashdot, Dashes and dots
This is the name of our hatch pattern followed by a description of the pattern, separated by a
comma. (,)
Now add this on the next line :
0, 0,0, 0,0.5, 0.5,-0.25,0,-0.25,0,-0.25
This line describes a single drawing pass over the hatch pattern. In this example we are only using a
single pass so we will only get one line. Save your file as "Dashdot.pat". If you loaded this hatch
pattern and added it to your drawing, it would look like this :
The first field, Angle, which in our case is "0", determines the angle at which the line is to be
drawn. In our case it will be drawn horizontally. Don't confuse this with the angle of the hatch
pattern which is controlled by the AutoCAD Hatch command. Look at a hatch pattern as a
successive series of lines that are drawn from left to right, then from down to up.
The second field is the X,Y Origin. This controls the starting point of the line segment. This is not
an AutoCAD co-ordinate, but rather a relative distance from the current Snap base point of the
drawing. All hatch patterns have a point of origin. Since this point of origin is the same throughout,
you're assured that the patterns will line up.
0, 0,0, 0,0.5, 0.5,-0.25,0,-0.25,0,-0.25
The third field is the X-Offset and Y-offset values. 0 is the X-Offset and 0.5 is the Y-Offset. The
hatch pattern will begin at an arbitrary origin and proceed to draw a group from left to right, then
advance upward in the Y direction.
0,0.5 means that each successive line in the pattern will move to the right 0 units and up by 0.5
units. This results in the 0.5 spacing between the lines. The offset is relative to the initial angle given
in the line, so that angle forms the X axis for the offset.
The Y value Offset is quite easy to understand - it gives you the spacing between the lines. But why
would you want to offset the X value, and what effect does that have? Think of a brick wall. Each
successive line of bricks is offset to the right a little to create a pattern. So, 0.5,1 would space the
bricks upward by 1 unit, and every other line would be offset by 0.5 to the right of the origin,
creating a "stepladder" effect.
0, 0,0, 0,0.5, 0.5,-0.25,0,-0.25,0,-0.25
The fourth and final group is the linetype definition or the dash dot pattern. In words, this pattern
is saying:
"Draw a line 0.5 units long, lift the pen for 0.25 units, draw a dot, lift the pen for 0.25 units, draw
another dot, lift the pen for 0.25 units, draw a third dot, lift the pen for 0.25 units and then repeat
the process".
The dashdot pattern was drawn using only one definition line, let's try one with two. Open a new
file with Notepad and add this :
*VASTRAP, Vastrap Checkered Plate
0, 0,0.09375, 0.25,0.25, 0.25,-0.25
90, 0.125,0.21875, 0.25,0.25, 0.25,-0.25
Close the file and save it as "Vastrap.pat". This hatch will produce a pattern like this :
Even though I defined the pattern with 0 and 90 degree lines, you can rotate the pattern to get the
desired effect. I made the pattern at 0 and 90 degrees to avoid having to calculate the angles.
(Chicken hey!)
As I said at the beginning, simple hatch patterns are quite easy to create, but the complicated one's?
Well, that's another story.
Would you like a couple of hundred hatch patterns to play around with and analyze? Some simple,
some "very" complicated! You would? Then just place your mouse here and click.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Custom Linetypes
There are two different ways of creating linetypes within AutoCAD. You can write your own
linetype definition file, or you can use AutoCAD's built in function to create it for you. In this
tutorial we'll look at both methods. Let's start with the AutoCAD built in function first.
Before we start though, let's have a look at what a linetype is.
A linetype is a series of positive and negative numbers that tell a plotter how long to lower or raise a
pen. Positive numbers lower the pen, and negative numbers raise it. The normal length of a dash is
.5; a dot is 0.
e.g. 0,-.25 would produce a series of dots. The first 0 produces the dot; the -.25 raises the pen .25 of
a unit. The series then repeats itself.
Easy hey! Now let's have a look at creating out own custom linetype. Let's say we want a linetype to
be dash, dot, dot, dot.
The format would be .5,-.25,0,-.25,0,-.25,0,-.25. and we'll call the linetype "dashdot3".
Fire up AutoCAD and enter the following at the command line :
Command: -linetype
Descriptive text: _ . . . _ . . . _ . . . _
To load and set your new linetype, enter "Linetype" at the command line. The "Linetype
Manager" dialogue will appear :
To create your own linetype definition is very simple. First locate your newly created "Afralisp.lin"
file, and open it using Notepad. It should look like this :
;
Yours will not have the first two lines as I added them later. Just precede any comments you wish to
add with ";".
As you can see, your linetype definition consists of 2 lines.
The first line consists of "*" followed by the linetype name followed by the description separated by
a comma ",".
The description is optional and can be a sequence of dots, spaces and dashes or a comment such as
"A Dashed Line followed by 3 Dots". If you omit the description, do not put a comma after the
linetype name. If you include a description, it should be no more than 47 characters long. (Why?
Who knows!!)
The second line starts with the "alignment" field which you specify by entering "A". AutoCAD
only supports one type of alignment field at this time so you will always enter "A".
Next comes a comma "," followed by your linetype definition.
Pretty easy hey. On the next page we'll have a look at complex linetypes.
To Page No II
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
If you loaded and set this linetype, it would look like this :
If we put this into words, we would be saying, "Draw a line 1 unit long, lift the pen for 0.25 of a
unit, then add "AL" as text using "STANDARD" font style, now lift the pen for 1.25 units, and
then repeat the process".
Let's have a wee look at the "AFRALISP" linetype :
*AFRALISP,---- AL ---- AL ---- AL ---- AL
The first line, of course is the linetype name followed by the description.
A,1.0,-0.25,["AL",STANDARD,S=1,R=0,X=0,Y=-0.25],-1.25
The second line contains the linetype definition. Lets, zoom into this.
"A" is the alignment which is defaulted.
"1.0" and "-0.25" are pen commands as is "-1.25" at the end of the definition.
["AL",STANDARD,S=1,R=0,X=0,Y=-0.25] is the one that interests us.
The syntax of these fields are as follows :
string ("AL")
style (STANDARD)
The name of the text style to be elaborated. The specified text style must be included. If it is
omitted, use the currently defined style.
scale (1)
S=value. The scale of the style is used as a scale factor by which the style's height is multiplied. If
the style's height is 0, the S=value alone is used as the scale.
Because the final height of the text is defined by both the S=value and the height assigned to the text
style, you will achieve more predictable results by setting the text style height to 0. Additionally, it is
recommended that you create separate text styles for text in complex linetypes to avoid conflicts
with other text in your drawing.
rotate (0)
R=value or A=value. R= signifies relative or tangential rotation with respect to the lines
elaboration. A= signifies absolute rotation of the text with respect to the origin; all text has the same
rotation regardless of its relative position to the line. The value can be appended with a d for
degrees (if omitted, degree is the default), r for radians, or g for grads. If rotation is omitted, 0
relative rotation is used.
Rotation is centered between the baseline and the nominal cap heights box.
xoffset (0)
X=value. This field specifies the shift of the text in the X axis of the linetype computed from the end
of the linetype definition vertex. If xoffset is omitted or is 0, the text is elaborated by using the
lower-left corner of the text as the offset. Include this field if you want a continuous line with text.
This value is not scaled by the scale factor that is defined by S=.
yoffset (-0.25)
Y=value. This field specifies the shift of the text in the Y axis of the linetype computed from the end
of the linetype definition vertex. If yoffset is omitted or is 0, the text is elaborated by using the
lower-left corner of the text as the offset. This value is not scaled by the scale factor that is defined
by S=.
Well that's about it for complex linetypes. But before I go, here's a few more custom linetypes that
you can play around and practice with :
;
;
;AfraLisp Custom Linetypes
;Written November 2001
;
;
*dashdot3,_ . . . _ . . . _ , , , _
A,0.5,-0.25,0,-0.25,0,-0.25,0,-0.25
;
*AFRALISP,---- AL ---- AL ---- AL ---- AL
A,1.0,-0.25,["AL",STANDARD,S=1,R=0,X=0,Y=-0.25],-1.25
;
*DIESEL,---- DIESEL ---- DIESEL ---- DIESEL ---- DIESEL ---- DIESEL
A,50,-2,["DIESEL",STANDARD,S=1.25,R=0.0,X=-1,Y=-.5],-6.5
;
*BEER,---- BEER ---- BEER ---- BEER ---- BEER ---- BEER
A,50,-2,["BEER",STANDARD,S=1.25,R=0.0,X=-1,Y=-.5],-6.5
;
*DRINKING_WATER,---- DRINKING H20 ---- DRINKING H20 ---- DRINKING H20
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
The repeating segments for complex lines are defined in the same manner as the simple
linetype. In a complex linetype, brackets are used to enclose the description of text to be
repeated along the line. The position and size of the text in relation to the repeating line
segments is determined with 4 controlling parameters named "transforms".
A transform will scale, rotate and offset in the X or Y direction the text in the complex
linetype. The following example will add text that repeats along the line when included in a
linetype definition.
If the text style used in the complex linetype has a height other than zero, then the
number in the S=? transform will be the multiplier for the text style height.
If the S=? transform is not included in the linetype definition, the text height is determined
by the height defined in the text style. If the text style is defined with a height of zero and
the S=? transform is not included in the linetype definition, the height of the repeating text
will default to 1 (one).
How to center the text in a complex linetype
The X=? and Y=? transforms are used to center align the repeating text. The X value
required can be determined from the width of the repeating space where the text is to
appear and the width of the repeating text. The repeating space is created by the
negative number preceding the text definition.
One way to determine the width for the repeating text is to place the text in a drawing and
use the distance command to measure the width. The DTEXT command can be used to
create the text. Use the same height for the text that you intend to use in the linetype.
After the space width and the character width have been determined, subtract the width of
the text from the blank space where the text is going to be placed, and divide by two.
Then subtract this number from the space to determine to distance to shift the text to the
left in the space. Make sure to use a minus sign (-) to make the number negative.
given:
SP = repeating space and W = width of the letters (text string)
To center the repeating text in the vertical orientation, divide the S=? transform by 2 and
For example, if you add text to a drawing that uses the same style as text in a complex
linetype, and you change the text style to have an oblique angle, the text will also be
oblique in the next complex linetype that is created in the drawing. For this reason, it may
be prudent to create unique styles for the text to be used in linetypes. Complex lines will
use those style settings until another style is used.
Note: You may need to perform a regen in order to see the changes display.
LTSCALE or CELTSCALE commands change the repeating text and the lengths of the
repeating patterns to a new size. The LTSCALE variable scales the repeating text and
line segments in every line in a drawing. This variable scales all complex linetypes
proportionally in the drawing. The CELTSCALE is not a global variable and only scales
lines created after it is set. The CELTSCALE variable also scales complex lines
proportionally.
*MYLINE,----OO----
A,1,-2,["OO",TEST,S=0.5,R=0,X= -1.42,Y= -0.25],1
*MYLINE,----OO----
A,1,-2,["OO",test1,S=0.5,R=0,X= -1.42,Y= -0.25],1
2-((2-0.83)/2)=1.42
The number is negative to move the repeating text back towards the start of the line into
the blank space.
The Y value is used to move the text perpendicular to the repeating line segments. In this
linetype the -0.25 is used to center the letters OO. This number is derived by dividing the
S=0.5 value by two. The number is negative to move it down in relationship to the
repeating line segments.
Helpful tips
If a text style that will be used in the linetype is not defined, the error "Bad
definition of (linetype name) at line (line#) of file filename.lin" will
appear when you attempt to load the linetype.
Use a text editor to create the complex linetype. If you try to create a complex
linetype from the AutoCAD command line, you will get the error: "INVALID
number or bad continuation". The linetype definition will not be saved.
Text objects in complex linetypes are displayed completely and never trimmed.
Put half of the repeating segment after the text definition. Adding a line segment
after the repeating text will ensure that a line segment will not cross the last text
object in the line when it is placed in a drawing. AutoCAD adjusts the line
segments to force the line to start and end with a dash.
The scale command adjusts the length of the complex linetype and not the size
of the repeating text or repeating line segments.
The complex linetype can only have one color in standard AutoCAD. It can be
set to color by layer or to any color using entity creation mode.
The text in a complex line is not a separate entity. The complex line cannot be
exploded.
Compiled shape files (.SHX files) can be used in complex linetypes. These .SHX
files must be created in AutoCAD. The location of the .SHX file must be set in
the support path under Preferences/ File System. Use the instructions in the
AutoCAD Customization Guide under Linetype Definition Files. An AutoCAD
drawing that contains such a linetype must be accompanied by the compiled
shape file or .SHX file where the shape is defined, as well as the .LIN file where
the linetype is defined.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Menu Loader
Loading partial men files can be a real pain. Having to first add all the menu directories to the
AutoCAD Support Path and then installing the menu files becomes a real hassle, especially if you've
got a number of workstations to take care of.
Here's a little application that takes a lot of the pain out of multiple standard menu installation.
I have used a small partial menu "Vbamenu.mnu" that contains one pulldown menu and one
toolbar as an example.
First, you need to have your support file directory structure set up and ready :
c:/vbamenu
c:/vbamen/lisp
c:/vbamenu/vba
In this example you can see that I've set up my main directory, "c:/vbamenu" with two
sub-directories, "lisp" and "vba."
My menu and lisp files, "vbamenu," "vba.dll," and "vbamenu.lsp" are stored in "vbamenu,"
whilst I would store any additional support files in the other two sub-directories.
In essence, these are the directories that I would need to add to my AutoCAD support path.
Next, fire up AutoCAD and open a blank drawing.
Now type this at the command line :
(load "c:\\vbamenu\\vbamenu)
;switch on dialogues
(setvar "FILEDIA" 1)
);progn
);progn
);if
);progn
);if
);if
(princ)
);defun
;parsing routine
(defun parse (str delim / lst pos)
(setq pos (vl-string-search delim str))
(while pos
(setq lst (cons (substr str 1 pos) lst)
str (substr str (+ pos 2))
pos (vl-string-search delim str)
)
)
(if (> (strlen str) 0)
(setq lst (cons str lst))
)
(reverse lst)
)
(princ);clean load
A big thank you to ActiveX.com for allowing me to borrow a wee bit of their coding.
To make sure that your menu is loaded every time AutoCAD starts, place this coding in your
Acad.Lsp file :
(defun-q VBAMENUSTARTUP ()
(setq flag1 T)
(progn
(if temp
(progn
(setvar "FILEDIA" 0)
(setvar "FILEDIA" 1)
(menucmd "P11=+VBAMENU.POP1")
);progn
(progn
);progn
);if
);progn
);if
(if flag1
);if
(princ)
);defun-q
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Preserving CustomToolbars
When you create, or edit, your toolbars for AutoCAD the changes, or new toolbars, are written into your
ACAD.MNS file (assuming your menu file is ACAD.MNU). As soon as you recompile your ACAD.MNU,
AutoCAD will write over these changes when it creates a new MNC, MNR and MNS file for the associated
ACAD.MNU. To preserve your new, or customized, toolbars follow these easy steps:
● Using any text editor (Notepad or Write will work) open up the
ACAD.MNS, or whatever menu's associated MNS file you are
using.
● Use the SEARCH or FIND utility to go to the TOOLBARS section of
the ACAD.MNS. The Toolbars section starts with the following
couple lines:
***TOOLBARS
**STANDARD_TOOLBAR
**TB_STANDARD_TOOLBAR
● Go to the toolbar(s) which you've either added or customized,
highlight it, then copy it to your clipboard. Usually any *new*
toolbars created will be at the end of the TOOLBARS section. For
example, if you've created a new toolbar named, MOSTUSED,
then go to the TOOLBARS section and search for MOSTUSED and
copy this portion to the clipboard.
● Open up the ACAD.MNU file in your text editor.
● Find the TOOLBARS section of the ACAD.MNU file using the
SEARCH/FIND utility. The TOOLBARS section starts with the
following lines:
//
// Begin AutoCAD ToolBars
//
***TOOLBARS
**STANDARD_TOOLBAR
● Now PASTE the contents of the clipboard into the TOOLBARS
section of the ACAD.MNU. By putting your customized, or new,
toolbars in the ACAD.MNU you will preserve them forever, even
when you recompile the ACAD.MNU.
● If you've editted, or changed, the HELPSTRINGS section you will
need to cut and paste these changes from the HELPSTRINGS
section of the ACAD.MNS to the HELPSTRINGS section of the
ACAD.MNU.
● Now that you've successfully cut and paste your customized
toolbars into the ACAD.MNU save the file, and exit.
● Whenever you need to recompile the ACAD.MNU now in AutoCAD,
the changes you've made will carry along without being overwritten
or lost.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(setq j 1)
(while (set (read (strcat "point_" (itoa j)))
(getpoint "\nPoint : ")
)
(setq j (1+ j))
)
;; Last point is nil.
(setq j (1- j))
;; Sort the points. See function "sortpoints" below.
(sortpoints j)
;; Initialize the list of points to be passed to (command "_line")
(setq lpt (list ""))
;; Construct the list and set each of our
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Program Looping.
AutoLisp uses 2 kinds of loops, namely (repeat) and (while).
Let's have a look at the (repeat) function first :
(repeat).
The (repeat) function is a simple looping structure. It executes any number
of statements a specific number of times. Like the (progn) function, all of
it's expressions get evaluated, but they get evaluated once each loop.
Here's a simple example :
(defun c:loop ()
(setq pt (getpoint "\nCentre of Rotation : "))
(setq n (getint "\nEnter Number of Steps : "))
(repeat n
(command "Rotate" "L" "" pt "20")
)
(princ)
)
Now draw a circle anywhere on the screen and then run the routine.
The circle should move around.
Note that the variable that controls the number of loops must be an integer.
(while).
The (while) function loops like (repeat) except that (while) has a
conditional test. (while) will continue looping through a series of
statements until the condition is nil. Here's an example :
(defun c:loop1 ()
(while
(setq pt (getpoint "\nChoose a point : "))
(command "point" pt)
)
(princ)
)
In this example, you can continue to pick points until you press Enter.
(AutoLisp treats Enter as nil). When you press enter the loop will terminate.
Here's another example :
(defun c:loop2 ()
(setq ptlist nil)
(while
(setq pt (getpoint "\nEnter Point or RETURN when done: "))
(defun c:loop3 ()
(setq count 0)
(while (< count 10)
(princ count)
(setq count (1+ count))
)
(princ)
)
You should get :
012345678910
If you know the number of times you want to loop, use (repeat), a much
simpler command than (while).
Hint : Have you ever wondered how to make an AutoLisp routine Auto-Repeat?
Enclose the whole function or sub-function in a (while) loop.
This way, the function will keep on repeating until Enter or Cancel is hit.
Enough for now, my brain hurts......
In fact, I think I'm going "Loopy-Loo"
Cheers....
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Conditionals.
(If) is probably the most important and widely use condition statement.
Unlike other languages though, you can match only one (if) statement with a then
statement. The syntax is as follows :
(if xyz
(then do this)
(else do this)
)
Let's look at a simple example :
(defun c:testif ()
(setq a (getreal "\nEnter a Number : ")
b (getreal "\nEnter Second Number : ")
);setq
(if (= a b)
(prompt "\nBoth Numbers are equal")
(prompt "\nBoth numbers are not equal")
);if
(princ)
);defun
(princ)
If you need to evaluate more than one then, or else statement, you must use the (progn) function.
Here's another example :
(defun c:testprogn ()
(setq a (getreal "\nEnter a Number : ")
b (getreal "\nEnter Second Number : ")
);setq
(if (= a b)
(progn
(prompt "\nBoth Numbers are equal")
(prompt "\nHere is Another statement")
(prompt "\nAnd Another One")
);progn
(prompt "\nBoth numbers are not equal")
);if
(princ)
);defun
(princ)
You can use as many statements as you like within the (progn) function.
You can also use (if) along with logical operators. They are functions that determine how two or
more items are compared. The available logical operators are :
(defun c:testand ()
(setq a (getreal "\nEnter a Number : "))
(if
(and
(>= a 5.0)
(<= a 10.0)
);and
(prompt "\nNumber is between 5 and 10")
(prompt "\nNumber is less than 5 or greater than 10")
);if
(princ)
);defun
(princ)
(defun c:testor ()
(setq a (getstring "\nAre you Male? Y/N : "))
(if
(or
(= a "y")
(= a "Y")
);or
(prompt "\nHello Sir")
(prompt "\nHello Madam")
);if
(princ)
);defun
(princ)
A Relation Operator is a function that evaluates the relationship between two or more items.
Relationship Operators available are :
(eq a c) would return nil, a and c are not the same list.
What about a Multiple (if) function. The (cond) function works very much like (if), except (cond)
can evaluate any number of test conditions.
Once (cond) finds the first condition that is true, it processes the statements associated with that
condition. (It only processes the first true condition). Here's an example :
(defun c:testcond ()
(setq a
(strcase (getstring "\nSize of Bolt (M10,M12,M16): ")
);strcase
);setq
(cond
((= a "M10") (prompt "\nYou have choosen M10"))
((= a "M12") (prompt "\nYou have choosen M12"))
((= a "M16") (prompt "\nYou have choosen M16"))
(T (prompt "\nUnknown Bolt Size"))
);cond
(princ)
);defun
(princ)
The (cond) function takes any number of lists as it's arguments.
Each argument must be a list containing a test followed by any number of expressions to be
evaluated.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
COND vs IF
Written by David Hoekstra
Published on AfraLisp with kind permission.
"IF I had a nickel for every COND statement that I ever wrote in lisp, I'd be rich!"
I see lots of lisp routines that use only the IF function for conditional statements. I think this has a lot to do
with the fact that most new AutoLISP programmers start out with IF, and never proceed on to COND. I have
talked to several lisp programmers who state that they never learnt how to use COND, and seemed to think it
was useless.
Because IF can only accept one statement for the then and else clause, you must use the PROGN to group
several statements as one statement:
(if (> angle 90)
(progn ;then clause
(setq ed (subst (cons 8 "somelayer") (assoc 8 ed) ed))
(entmod ed)
(entupd en)
) ;_ progn
(princ "\nNothing changed.") ;optional else clause
) ;_ if
The "then" clause needs to run several statements if the predicate is true (> angle 90), if the symbol "angle" is
greater than 90. Because IF only accepts one statement for a then clause, you must artificially wrap the three
statements into a grouped statement by use of PROGN. Now let's compare this to the same operation, but
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Error Trapping.
This was another area that caused me quite a bit of confusion when I was first learning AutoLISP. All
AutoLISP routines should contain Error Trapping. There is nothing worse than running a routine and
finding out that once it has run, or been cancelled, your system variables, etc. have all changed and
nothing works the same any more.
I am going to look at two types of Error Trapping here. Firstly, an Error Trapping routine build into a function, and
secondly, a Global Error Trapping function. But first, some background on the AutoCAD *error* function.
AutoLISP provides a method for dealing with user (or program errors).
It is one of the only AutoLISP functions that is user-definable.
This is the *error* function.
(*error* string)
(princ)
Now our Global Error Trap named Error.Lsp
(defun error() ;load function
(prompt "\nGlobal Error Trap Loaded") ;inform user
(princ)
);defun
;;;*==========================================================
(defun initerr () ;init error
(setq oldlayer (getvar "clayer")) ;save settings
(setq oldsnap (getvar "osmode"))
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This, I believe, is one of the most useful functions in the AutoCAD stable.
In a nutshell, you feed it a point, tell it the angle and distance from that point that you want to be, and it will
return the second point.
Can you imagine having to do that using car, cadr, etc.
First you would have to break the list down into each separate component, do all the calculations on each
individual item, and then re-construct the list.
What a pain!!
Following is an example of how to use POLAR to construct a simple square
or rectangle from values input by the user :
(defun DTR (a) ;degrees to radians function
(* PI (/ a 180.0))
);defun
;=========================================
(defun C:BOX1 (/ IP P1 P2 P3 LENGTH HEIGHT ;define function and declare
OLDSNAP OLDBLIP OLDLIGHT) ;variables as local
As you can see, we first need to write a function to convert radians to degrees. This is because when we deal
with angles in AutoLISP they must be in Radians.
Hint : This could be a Global function loaded from your Acad Lisp file.
Now to our main routine.
The first thing that we do is define the function and declare all the variables as local. (Only used within this
program.)
Then we save certain system variables, before changing them, so that we can reset them later.
Next we ask the user for Insertion Point, Length and Height of the box.
We then use the POLAR function to calculate the remaining 3 corners of the box. (PT1, PT2 and PT3).
Then, just to be kind, we allow the user to rotate the box.
(That's why we drew the box using a Pline.)
Lastly, we reset all the system variables that we changed back to their original state.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Locating Files.
AutoLISP has two functions available to help us locate files.
They are the (findfile) function and the (getfiled) function.
(findfile).
The (findfile) function will only search the current AutoCAD search path if a drive/directory
prefix is not supplied.
If the file is found, the full directory path is returned.
(findfile "filename")
Say you were looking for the file ACADR14.LSP.
(findfile "ACADR14.LSP)
Would return :
"C:\\ACADR14\\SUPPORT\\ACADR14.LSP"
Note :
AutoLisp allows you to use / or \\ for directory descriptors.
(getfiled).
The (getfiled) function will prompt the user for a file name using the standard AutoCAD file
dialogue box. It will then return the file name either with the full path name or with the path
name stripped.
The syntax of the (getfiled) function is as follows :
(getfiled "Title" "Directory Path and/or File name" "File Extension" Flag)
The "Title" argument is simply the name that will appear in the Title Bar of the dialogue box.
The "Directory Path and/or File Name" argument is the default directory path that the dialogue box
will use. If a file name is included this name will appear in the File Name edit box. This can be null.
The "File Extension" function is the default file name extension. If it is null, it defaults to * (all file
types). If the file type "dwg" is part of the "File Extension", an image preview is displayed.
There are four possible flags and they make use of the "sum of the flags" concept.
To combine any of the flags, just add them together. The flags are :
Flag 1. If you set this flag, the function will prompt for the name of a
NEW file to create.
Flag 4. This flag will disable the "Type it" button. The user must then
pick from the listed files rather than type a file name.
If this flag is not set and the user selects the "Type it" button,
the dialogue box disappears and (getfiled) returns a value of 1.
Let's look at an example. We want to open a directory on c:/ called "Slides" containing a list of file that
we would like to view. Our routine would look like this :
As you can see, this is quite a useful function in that it can restrict your user to only certain directories
and file types whilst still leaving them some flexiblity in their choice.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
File Handling.
AutoLisp can only deal with one type of external file, namely an ASCII text file.
As well as this, AutoLisp can only read a file in sequential order. (It does not have
random access.)
Despite these drawbacks, AutoLisp has certain basic tools that allow you to read and
write one character at a time, or a full line at a time.
You can also append data to an existing file.
File: #28a27d2
This is the file handle returned by the operating system and stored in variable "file".
Try this now :
(write-line "This is some test data." file)
This "writes" a line of data to the file with handle "file".
(write-line "This is some more test data." file)
Let's write some characters to the same file :
(write-char 79 file)
This would write the ASCII character "O" to the file.
(write-char 75 file)
This would write the letter "K"
Now let's close the file :
(close file)
To read a file is just as simple :
(setq file (open "testfile.txt" "r"))
Open "Testfile.txt" to "Read".
(read-line file)
Read the first line.
Lisp should return :
(read-line file)
Lisp should return "nil" as we have reached the end of the file.
Before moving on, you should always make sure that you close
your files.
(close file)
Append is very similar to writing to a file except the file must already
exist if you want to append to it.
There are three other functions that write to an external file.
They are (princ), (prin1) and (print).
Let's have a look at them :
(setq file (open "afile.txt" "w"))
(princ "This is the (princ) function" file)
(prin1 "This is the (prin1) function" file)
(print "This is the (print) function" file)
(close file)
Open the file "afile.txt". You should have the following :
This is the (princ) function"This is the (prin1) function"
"This is the (print) function"
All 3 functions display the result at the prompt line and send the
output to a file. Here are the differences :
(princ) displays strings without quotation marks.
(prin1) displays strings with quotation marks.
(print) displays strings with quotation marks and places a blank line
before the expression and a space afterwards.
Now we will look at a practical example :
The following is a Drawing Log Routine that logs the date, time, &
Drawing Name of each Drawing Session. It writes a report
to an ASCII Text file (Log.Txt).
Load the file and type "Login" to run it. Leave it for a minute or so and then type "Logout" to exit
the routine.
Have a look at the file Log.txt. It should look something like this :
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
External Data
Do you have a library full of blocks taking up vast amounts of disk space?
Do you find it difficult to locate a specific block because you've got so many or cannot
remember what you called it?
By using external data you can parametrically draw these objects. If you look at my
Structural Steel Programme DDSTEEL you will notice that every section is drawn using
data retrieved from an external data file.
The following tutorial will show you how to retrieve external data, format it into
something that Autolisp can use, then place the data into individual variables.
Oh No, Commas...Don't worry the next section of the program deals with them. It parses the data
and removes all commas so that we end up with a LIST looking like this :
(152.0 10.0 124.0)
Now by using the mapcar function we can allocate each item in the list to its own variable.
(mapcar 'set '(a b c) dlist)
I have deliberately not declared these variables as locals so that you can view them within
AutoCAD.
Type !dlist to view the data list.
Type !a to see the first item in the list.
Type !b to see the second item in the list.
Type !c to see the third item in the list.
You can now use this data to draw your object.
As you can see, this is a much more efficient way of drawing objects that are the same shape but
have differing dimensions.
To save you having to type here is the source code for the whole
of this routine. Now don't you think I'm good to you?
Test Zip (7 Kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Caddr
This returns the third element of a list. (The z coordinate.)
(setq c (caddr pt1))
Would return :
(0.0)
AutoLisp has other functions that will retrieve values from lists of more than three elements. (Caar,
cadar, etc). You can, though, us another function to access any element of a list. This is the "nth"
function.
nth
The syntax for the nth function is as follows :
(nth num list)
"num" is the number of the element to return. Just remember that zero is the first element. For
example given the list :
(setq d '("M10" "M20" "M30" 10.25))
(setq e (nth 0 d))
Would return :
("M10")
And likewise :
(setq f (nth 3 d))
Would return :
(10.25)
On the next page we will look at a practical example of using these functions.
Home. Page II. Page III.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(setq a 200.0)
(setq b 400.0)
You want to combine them to create a new list. To do this you would use the "List" function. For
example :
(setq c (list a b))
Would return :
(200.0 400.0)
You could also write the function like this :
(setq c '(a b))
Here's an example of List Manipulation. We are going to use the (car), (cadr) and (list) function to
draw a rectangle.
(defun c:rec ( / pt1 pt2 pt3 pt4)
(princ)
);defun
;**********************************************************
Let's look closer at the line :
(setq pt2 (list (car pt1) (cadr pt3)))
This function retrieves the first element (x coordinate) from the list pt1, the second element (y
coordinate) from the list pt3, creates a list from these elements and stores the list in the variable pt2.
The following diagram should help you to better understand this.
AutoLisp provides other functions to manipulate lists. Let's have a look at some of them.
Append
This takes any number of lists and runs them together as one list :
(append '(12.0 15.5) '("M20" "M30))
Would return :
Would return :
("M30")
Length
This returns an integer indicating the number of elements in a list :
(length '("M20" "M24" "M30"))
Should return :
(3)
Member
This function searches a list for a specific element. If found it returns the element plus the
remainder of the list :
(member 'c '(a b c d e f))
would return :
(c d e f)
Reverse
Returns a list with it's elements reversed :
(reverse '(a b c d e f))
Will Return :
(f e d c b a)
Subst
Searches a list for an old element and returns a copy of the list with the new item substituted in
place of every occurrence of the old item :
Syntax : (subst newitem olditem lst)
Would return
(a b f d e f)
On the next page we will have a look at a more advanced List Manipulation Example.
Page I. Home. Page III.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(defun c:example ()
(setq oldhigh (getvar "Highlight")
oldsnap (getvar "Osmode")
oldblip (getvar "BlipMode")
oldecho (getvar "Cmdecho")
);setq
(setvar "Highlight" 0)
(setvar "Osmode" 517)
(setvar "Blipmode" 0)
(setvar "Cmdecho" 0)
Programme statements.............
.................................
(setq no 0)
);repeat
(princ);finish quietly
);defun
;***************************************************************
(defun varset ()
(setq no 0)
;set counter to zero
);repeat
(princ);finish quietly
);defun
;***************************************************************
(princ);load quietly
(varget)
;store system variables and then reset them
Programme statements.............
.................................
(varset)
;restore system variables
(princ)
);defun
As you can see, we have reduced the size of our routine by a lot and saved ourselves quite a bit of
typing. These two routines could both be loaded from our Acad.Lsp file so that they would be
available to all of your routines.
If you would like the source coding for this AutoLisp Tutorial then Click Here. Ta Ta for Now......
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(setq a (entlast))
Lisp should return something like this:
<Entity name: 2680880>
This is the Entity Name of the Line that you have just drawn.
Now type "Erase" then !a and press Enter twice.
The line should disappear. Type "OOPS" to bring it back.
You have just modified the AutoCAD Database.
Now type this :
(setq b (entget a))
This will retrieve the Entity Data. It should look something like this :
((-1 . <Entity name: 2680880>) (0 . "LINE") (5 . "270")
(100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbLine")
(10 400.378 621.82 0.0) (11 740.737 439.601 0.0)
(210 0.0 0.0 1.0))
Now type this line:
(setq c (cdr (assoc 10 b)))
Lisp should return:
(400.378 621.82 0.0)
Before you type the next few lines, make sure that your snap is turned off.
Command: circle
3P/2P/TTR/<Center point>: !c
Diameter/<Radius> <10.0>: 20
A circle should be drawn at the end of the line.
This exercise was just to show you the ability of AutoLisp to go behind your drawing, into the
database, and manage graphic and non-graphic information. This tutorial will show you how
entities are stored and referenced in the database.
It will show you how AutoLisp reveals data about entities and how they can be modified and
manipulated. Say au revoir to your wife and kid's and let's visit the AutoCad Database. (Star Trek
theme music now starts......)
Home. Page II. Page III.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Counts the number of entities in the selection set 'a1' and stores this number in variable 'n'.
(setq index 0)
Sets the loop control variable 'index' to zero.
(setq b2 (entget (car a2)))
This statement retrieves the entity list from 'a2' and assigns it to 'b2'.
(setq d2 (assoc 8 b2))
This looks for the code 8 in the entity list 'a2', and then assigns the sub list to 'd2'.
(repeat n
This begins the loop that pages through the selection set.
(setq b1 (entget (ssname a1 index)))
This gets the entity list and assigns it to 'b1'.
(setq d1 (assoc 8 b1))
Gets the sublist code 8. (The Layer)
(setq b3 (subst d2 d1 b1))
Substitutes the new 'd2' layer for the old 'd1' layer in the entity list 'a1', and assigns it to the new
entity list 'b3'.
(entmod b3)
Updates the new entity list in the database.
(setq index (1+ index))
Increases the 'index' variable by 1, priming it for the next loop.
);repeat
Closes the repeat loop.
(princ)
Finish cleanly.
);defun
Closes the function.
(princ)
Clean Loading.
Listed below is another routine that allows you to globally change the height of text without
affecting other entities. As you will see, the only difference is, is that we have added a conditional
filter to the routine.
(defun C:CHGTEXT ( / a ts n index b1 b2 b c d)
(setq a (ssget))
(setq ts (getreal "\nEnter New Text Height : "))
(setq n (sslength a))
(setq index 0)
(repeat n
(setq b1 (entget (ssname a index)))
(setq index (index+ 1))
(setq b (assoc 0 b1))
(if (= "TEXT" (cdr b))
(progn
(setq c (assoc 40 b1))
(setq d (cons (car c) ts))
(setq b2 (subst d c b1))
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
} //end list
} //end dialog
(setvar "cmdecho" 0)
;switch off command echo
(setq userclick T)
;set flag
(setq f 1)
(while
;start while loop
(setq f nil)
;reset pointer
);if
);while
);not
(exit)
;if problem exit
);if
(start_list "sel1")
;start the list
(end_list)
;end the list
(action_tile
"cancel"
);action_tile
;if cancel set flag to nil
(action_tile
"accept"
(strcat
"(progn
);strcat
);action tile
;if OK get the layer selected
(start_dialog)
(unload_dialog dcl_id)
(if userclick
;if flag true
(progn
);end progn
);end if
(princ)
);defun C:getlay
(princ)
If you would like the source coding for this AutoLisp Routine then simply Click Here. Cheers and
keep well......
Page I. Page II. Home.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Selection Sets.
When you work with AutoCAD, you very seldom work with only one entity or, for that matter,
one type of entity. To be able to work efficiently with a group, or selection set, of entities, you
need to be able to place them in one place and work on them as a group. You might also want
to filter the entities so that only a certain type is within the group.
The AutoLisp function that enables you to do this is the (ssget) function.
);end repeat
Here's an example of a simple routine that will count the number of blocks
contained within a drawing :
(defun c:bcount ( / p1 b a n)
(progn
;if there is...
);progn
;if there are no blocks
);if
(princ)
);defun
(princ)
Well that's about it with selection sets. Just remember that you can save yourself an awful lot of work by
using selection sets with filters.
Filter at the source rather than programmatically trying to filter out the undesirable entities at a later
stage. Ta Ta for now........
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Very often I will want to select all items on a layer and move them off to the right hand side of my workspace,
but what happens if I want to select two layers? There are always several ways to do things. I have found
using the filter command is somewhat cumbersome. Another way to use these filters is from the ssget
function.
Command: copy
This will only allow you to select circles on mylayer. If you wanted to select all the circles on layers mylayer and
mylayer2 it would look as follows.
Command: copy
Select objects: (ssget ‘((0 . circle) (-4 . “<or”) (8 . “mylayer”) (8 . “mylayer2”) (-4 . “or>”)))
The –4 dxf group code (-4 . “<or”) begins the conditional operator. The less than or open alligator symbol <
tells AutoCad to evaluate the conditional until it finds a closing alligator >. We use (-4 . “or>”) to end the
conditional.
(-4 . "<or")
(8 . "notes") (0 . "circle")
(-4 . "<and")
(8 . "s-boundary")(0 . "line")
(-4 . "and>")
(-4 . "or>")
))
This would select only those entities that are on the layer notes or are circles and entities that are both lines on
the layer s-boundary.
Conditional operators -- AND, OR, XOR, and NOT -- must be paired and balanced correctly in the filter list. The
number of operands you can enclose depends on the operation. Here is a list of the Conditionals or “selection
set filters” you can use:
The XOR conditional works as an exclusive OR operator. For instance, using OR we may select entities that
are text and are either on the layer notes or have the color 3 or both.
(ssget ‘((0 . “text”) (-4 . “<or”) (8. “notes) (62 . 3) (-4 . “or>”) ))
However, using XOR we may select only entities that are text and on layer notes or entities that are text and the
color 3. We cannot select entities that are text on the layer notes and the color 3.
(ssget ‘((0 . “text”) (-4 . “<xor”) (8. “notes) (62 . 3) (-4 . “xor>”) ))
If we wish to select text that is both on the layer notes and the color 3 using XOR we must group these
properties with another conditional.
(ssget '(
(0 . “text”)
(-4 . "<xor")
(-4 . "xor>")
))
(-4 . "or>")
(-4 . "xor>")
))
This is probably not practical, but it will work. See if you can figure out what it would select. There is not really
all that much to these conditionals and they are very handy. I use them mostly at the command prompt to copy
several layers at once, which tends to be easier then using the filter dialog box. The following lisp routine will let
you copy all the objects from two layers.
(defun c:layer_copy ( / laa la p1 p2 ss )
(setq ss (ssget "x" (list (cons -4 "<or") laa la (cons -4 "or>") )))
(command "copy" ss )
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Before you do anything in regards to layers and styles, it's always best to retrieve the current layer,
or text style, so that you can restore it. To retrieve the current layer, use the following coding :
(setq oldlayer (getvar "CLAYER"))
This will retrieve the name of the current layer and store it in variable "oldlayer". To restore the
previous layer is just as simple:
(setvar "CLAYER" oldlayer)
This will set the current layer to the previous layer name stored in variable "oldlayer".
You would use exactly the same syntax for retrieving and restoring the name
of the current Text Style :
(setq oldstyle (getvar "TEXTSTYLE"))
(setvar "TEXTSTYLE" oldstyle)
You might think that this would be a good way of changing layers and style.
The problem here, is that if the layer name you want to change to does not exist your program will
crash.
You can use the "tblsearch" function to test if a layer or style exists :
(tblsearch "LAYER" "TESTLAYER")
(tblsearch "STYLE" "MYSTYLE")
If Layer "TESTLAYER" or Style "MYSTYLE" exists in your drawing, tblsearch will return
"True", otherwise it will return "Nil".
Here's an example that tests if a layer exist, and if it does, sets the current layer to that layer:
(setq oldlayer (getvar "clayer"))
;retrieve the current layer
(if flag
;if the layer exists
);end if
This though, is quite a lot of coding just to check if a layer exists.
A better way, that applies to both Layers and Text Styles is to use the command function:
(command "Layer" "M" "NEWLAYER" "")
(command "Style" "Italict" "Italict.shx" "" "" "" "" "" "")
Both of these examples will change the layer or style, but will also create a new layer or text style if
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Extended Entity Data though, allows you to attach up to 16K of information to each and every entity in the
drawing. You can also keep it totally separate from other information and, because it uses a uniquely registered
name, can be kept relatively safe from being overwritten. You can also store lot's of different types of
information in Extented Entity Data.
Extended Entity Data is attached to an entity as an associated list with a code number of -3. The simplest form of
an Xdata Associative list would look something like this :
((-3 ("AFRALISP" (1000 . "Kenny is great"))))
Firstly, let's look at some of the different types of xdata that you can attach to an entity :
String 1000. A string of up to 255 characters.
Application Name 1001. An Application Name.
Layer Name 1003. The name of a Layer.
DataBase Handle 1005. The handle of an entity.
3D Point 1010. A 3D Coordinate value.
Real 1040. A real value.
Integer 1070. A 16 bit integer (signed or unsigned).
Long 1071. A 32 bit signed (long) integer.
Control String 1002. A control code to set off nested list.
World Space 1011. A 3D coordinate point that is moved, scaled
Position rotated, streched and mirrored along with the
entity.
World Space 1012. A 3D coordinate point that is scaled, rotated
Displacement or mirrored along with the entity. It cannot
be stretched.
World Space 1013. A 3D coordinate point that is rotated
Direction or mirrored along with the entity. It cannot
be scaled, streched or moved.
Distance 1041. A real value that is scaled along with the entity.
Used for distance.
Scale Factor 1042. A real value that is scaled along with the entity.
Used as a scale factor.
Another important thing to remember about Xdata is that you can have more than
one of the same associative code.
Let's attach some xdata to an entity in a drawing. Draw a line then type this:
(regapp "AFRALISP")
AutoLisp should return :
"AFRALISP"
You have now registered your external entity data name. This name is a unique identifier to your own extended
entity data.
Next we need to get the entity data list of the entity that we want to add exdata to. Type this :
(setq oldlist (entget (car (entsel))))
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Home. Page I.
} //end list
} //end list
} //end dialog
And now the AutoLisp code:
(defun c:exbolt ( / )
;define function
(setvar "cmdecho" 0)
;switch off command echo
(progn
;do the following
(regapp "AFRALISP")
;if not, register it
);if
(entmod e)
;modify the entity
);progn
);if
(setq userclick T)
;set flag
(setq NAMES '("M6" "M8" "M10" "M12" "M16" "M20" "M24" "M30" "M36"))
;create list of bolt sizes
(setq LEN '("10" "15" "20" "25" "30" "35" "40" "45" "50" "55" "60"))
;create list of bolt lengths
);not
(exit)
;if problem exit
);if
(start_list "sel1")
;start the list
(start_list "sel2")
;start the list
(end_list)
;end the list
(cond
;on condition
);end cond
(action_tile "rb1"
;if radio button rb1 selected
"(setq gr \"4,6\")"
;set grade of bolt
);action_tile
(action_tile "rb2"
;if radio button rb2 selected
"(setq gr \"8,8\")"
;set grade of bolt
);action_tile
(action_tile "rb3"
;if radio button rb3 selected
"(setq gr \"HSFG\")"
;set grade of bolt
);action_tile
(action_tile "cancel"
;if cancel selected
"(done_dialog)
;end dialog
);action_tile
;if cancel set flag to nil
(done_dialog)
;end the dialog
);action tile
(start_dialog)
;start the dialogue
(unload_dialog dcl_id)
;unload the dialogue
(if userclick
;if OK has been selected
(progn
;do the following
(entmod e8)
;update the entity
);end progn
);end if
(princ)
;finish cleanly
);end defun
(setq NAMES '("M6" "M8" "M10" "M12" "M16" "M20" "M24" "M30" "M36"))
;create list of bolt sizes
(setq LEN '("10" "15" "20" "25" "30" "35" "40" "45" "50" "55" "60"))
;create list of bolt lengths
(setq i 0)
;set counter to zero
(repeat lg
;repeat for the number of entities with bolt xdata
(princ GR fn)
;print the bolt grade
);end repeat
(close fn)
;close the file
(princ)
;finish cleanly
);end defun
(princ)
;load cleanly
As you can see, you can attach xdata to any type of entity, and attach all sorts
of different types of information.
Well, that's about it for now. If you would like the source coding for the applications written on this page,
then just click here.
Home. Page I.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(mapcar).
The function (mapcar) allows you to perform a "function" on each element of the list.
Let's try a simple example :
(lambda).
Now this is where the (lambda) function comes into play.
(lambda) allows you to write the (dtr) function "in-line" within the (mapcar) expression
without having to define a separate function.
There are another two AutoLisp commands that can apply a function to a list.
They are (apply) and (foreach).
Let's have a quick look at them.
(apply)
This function differs from (mapcar) in that it applies a function to the whole list and not to
the individual items in the list.
Here's a couple of examples :
(foreach)
The syntax for this is :
This function steps through list, assigning each element to name, and evaluates each expression for
every element in the list.
For example :
(foreach n a (princ n) (terpri))
If you had a list :
(setq a (1 2 3 4 5))
The previous expression would print vertically :
1
2
3
4
5
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
(while
;while a return is not entered
(princ (strcat "\nDistance = " dst " Accum Dist = " adist))
;display the distance and the running total
);end while
(princ)
;clean finish
);defun
(princ)
;clean loading
We start of the function by defining a list that only contains the '+' function.
The heart of the routine is nested in a 'while' loop. As long as the user keeps on adding distances,
the routine runs, but as soon as he hits a return, 'while' evaluates to nil and the loop is ended.
The first line within the loop simply gets the required distance. The second line
appends the distances to the list. Thirdly, we evaluate the list adding all of the
distances together. We then format the distance and the running total and display them to the user.
Once the user has finished selecting the distances, we display the final total. Simple really!!
Hint - Have you ever thought of building a macro recorder similar to that used
in Excel. By storing the users AutoCAD commands in a list along with the AutoLisp command
function, you could use the 'eval' function to 'playback' the list of commands. For example :
Here's another example of using the (eval) function, but this time we'll use it to replace the (cond)
function.
The following coding is a small application that converts various values. It uses the (cond) function
to determine which radio button was selected and then uses that information to run the relevant
sub-routine.
First the DCL coding :
: radio_button {
key = "rb1" ;
label = "&Inches to Millimetres" ;
value = "1" ;
}
: radio_button {
key = "rb2" ;
label = "&Millimetres to Inches" ;
}
: radio_button {
key = "rb3" ;
label = "M&iles to Kilometres" ;
}
: radio_button {
key = "rb4" ;
: edit_box {
key = "eb1";
label = "Value";
value = "1.0";
}
ok_cancel ;
}
//DCL CODING ENDS HERE
);not
(exit)
;exit if no dialog
);if
(mode_tile "eb1" 2)
(action_tile
"accept"
(strcat
"(progn (setq edval (atof (get_tile \"eb1\")))"
"(done_dialog) (setq userclick T))")
);action tile
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
);action_tile
(start_dialog)
(if userclick
(cond
);cond
);if userclick
(princ)
);defun
;-------------------------
(defun IM (val)
(setq ans (* val 25.4))
)
;-------------------------
(defun MI (val)
(setq ans (/ val 25.4))
)
;-------------------------
(defun MK (val)
(setq ans (* val 1.609344))
)
;-------------------------
(defun KM (val)
(setq ans (/ val 1.609344))
)
;-------------------------
(princ)
;AUTOLISP CODING ENDS HERE
);cond
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Redefining Commands.
Most AutoCAD users know that it is possible to undefine an AutoCAD command and then redefine
it to do something else. But, very few people seem to use this very useful feature. I find it very
handy to stop people changing system settings that divert from drawing office standards. Let's
have a look at an example of this.
Say we had a block inserted into the drawing that we did not want to be exploded because it
contains attributes. This is how we would go about using AutoLisp to undefine and then redefine
the 'Explode' command.
;If you wish to add additional block names, and want an easy way to
;figure out which ones you screened for each release, use this line with
;your block names.
;(setq lst1 (append lst1 (list "DRGTITLE2" "DRGTITLE3" "DRGTITLE4")))
;if it is not
(progn
;do the following
(command ^c^c)
;cancel any commands
);progn
)
;if
(princ)
;finish clean
);defun
(princ)
;load clean
We would, of course, load Redefs.Lsp from our Acad.Lsp file to ensure that it would be available all of the
time. Just please note, that because this routine uses the 'Command' function, we would have to load it from
the S::STARTUP section of the Acad.Lsp file. It would look something like this :
(defun S::STARTUP ()
(prompt "\nAfraLisp Custom Utilities Loaded....\n")
(load "REDEFS" "\nREDEFS.LSP not found")
(princ)
);defun
I'll tell you what we'll do next. Let's create our own Drawing AutoSave.
First of all we need a way to check when a certain amount of time has elapsed. One of the simplest ways of
doing this is to use one of the commonest used commands as a trigger. We'll use the 'Line' command.
Add the following coding to Redefs.Lsp :
Firstly we need to undefine the 'Line' command:
(command "UNDEFINE" "LINE")
;undefine the Line command
The we need to redefine it:
(defun C:LINE ()
;define the function
(autosave)
;call the Autosave function
(command ".LINE")
;call the line command
(princ)
);defun
Next we need to write our Autosave function:
(defun AUTOSAVE ( / T1 ECC)
;define the function
(setvar "CMDECHO" 0)
;switch it off
(if (not T2) (setq T2 (getreal "\nHow many minute between Saves ??: ")))
;check if we have an AutoSave time.
;if we haven't got it, then get it.
(progn
;if it is time to save
(command "QSAVE")
;save the drawing
);progn
);if
(princ)
);defun
The first time you select the Line command, this function will ask you for an interval between saves. From
then on, every time you use the Line command the function will check to see if you have exceeded the time
interval. If you haven't, it will do nothing. But if you have, it will first inform you, and then save your
drawing. Handy little thing, Hey...
To download source coding for Redefs.lsp Click Here. (1Kb)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Efficient Variables.
Every variable used in an AutoLisp routine uses up system resources. You've probably been advised
before now, not to use too many SETQ's. LISP, itself was originally a functional language, without any
variables. Here is a typical example of how we all go about collecting the values required for our routines.
(setvar "Highlight" 0)
;switch off highlight
(setvar "Cmdecho" 0)
;switch off command echo
(princ)
);defun
;This function constructs the list and adds it to the main list
(defun AList (Name Val)
);defun
);defun
(princ)
After running this routine, the value of the variable MainList would look something like this :
(("FourthPoint" 456.598 514.007 0.0) ("ThirdPoint" 676.92 293.827 0.0)
("SecondPoint" 1030.95 526.155 0.0) ("FirstPoint" 576.636 732.669 0.0)
("OLDECHO" . 0) ("OLDHIGH" . 1) ("OLDSNAP" . 32))
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
You will find the "DIR" parameters under the "Examples of external commands for command
windows" section within your Acad.pgp file.
The Acad.pgp file can normally be found within your AutoCAD Support directory.
eg. C:/Program Files/Autocad 2002/Support/Acad.pgp.
You can simply open and edit this file using Notepad.
The "DIR" command is a DOS (remember that dark place) command that displays a list of
a directories files and subdirectories. But did you know that you can use the "DIR"
command from within AutoLisp? This is a great function for obtaining a list of files in a
directory, especially useful for Batch Processing Routines.
Let's have a look at it. Fire up AutoCAD and type this at the Command prompt :
This is a listing of all the files and sub directories contained in your current working directory.
O.K. I know, it's not quite formatted the way we would want it to be.
So, let's use a couple "DIR" switches to format the file list the way that we would like it. Try this :
Command: (command "dir" " /b *.* >temp.txt")
That's better, we've now got just the file names. The /b switch limits the list to only file names.
Temp.txt should now look something like this :
9961.DXF
9962.DXF
Ant.exe
batchp1.exe
BatchPurge.Exe
DCLTUT.GIF
debex
N1.dxf
NAMDEB.DXF
projair.dwg
R12K47646.dwg
sort.dwg
SORTER.dwg
temp
temp.txt
test
title.dwg
truss1.dwg
truss2.dwg
uniglide.dwg
VALVE.dwg
Right, now retrieve just the DWG filenames :
Command: (command "dir" " /b *.dwg > temp.txt")
Temp.txt should now look something like this :
projair.dwg
R12K47646.dwg
sort.dwg
SORTER.dwg
title.dwg
truss1.dwg
truss2.dwg
uniglide.dwg
VALVE.dwg
That's it, we have now got our required file listing in the format that we require. The "DIR"
command has got a lot more switches that you can use to restrict your listings to whatever you
desire. I suggest you dust off one of your old DOS Reference Manuals and look "DIR" up.
Hint :
Would you like a listing of all the files in the current directory AND all sub-directories? Use the /s
switch :
Command: (command "dir" " /b/s *.dwg >temp.txt")
You should get a listing something like this :
O:\E51D\E51D1\projair.dwg
O:\E51D\E51D1\R12K47646.dwg
O:\E51D\E51D1\sort.dwg
O:\E51D\E51D1\SORTER.dwg
O:\E51D\E51D1\title.dwg
O:\E51D\E51D1\truss1.dwg
O:\E51D\E51D1\truss2.dwg
O:\E51D\E51D1\uniglide.dwg
O:\E51D\E51D1\VALVE.dwg
O:\E51D\E51D1\test\SCANNEX1.dwg
O:\E51D\E51D1\test\SCANNEX2.dwg
O:\E51D\E51D1\test\SCANNEX3.dwg
O:\E51D\E51D1\test\SCANNEX4.dwg
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Command: change
Select objects: 1 found
Select objects: <enter>
Specify change point or [Properties]: p
Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: c
Ha, take that you bounder. Let's look at the entity list again :
Hey, Group Code 62 has suddenly appeared in our list and tells us that the object is now colour 4!!!
Jeepers, AutoCAD is only clever.
But what happens if we want to change the line back to it's "Bylayer" colour and Linetype?
Have a look at the following :
Select the object :
Command: (setq sel (ssget))
Select objects: 1 found
Select objects: <enter>
<Selection set: 4>
Yep, everything is hunky dory! Our entity list has been updated with the correct values.
Hey, this is great. Let's try the same thing, but this time with Linetypes.
Change your line to Linetype "CENTER2".
Command: CHANGE
Select objects: 1 found
Select objects: <enter>
Specify change point or [Properties]: P
Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: LT
Enter new linetype name <ByLayer>: CENTER2
Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: <enter>
Now, is that not interesting? Let's put it into practice. Open Notepad and paste this coding into it,
saving it as "ColorToLayer.Lsp" :
;CODING BEGINS HERE
(defun c:ColorToLayer ()
);progn
);if
;loop
);repeat
(princ)
(princ)
You can easily write coding that will do exactly the same for Linetypes and even incorporate the
two if you wish.
You could even take it a step further and develop a fully fledged Layer Mapping Application
Manager. Makes you think doesn't it?
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Debugging
Screams, intermittent yells and bangs, kid's and dogs cowering in the corner. What is going on?
Have I gone nuts? Have I finally cracked and lost my mind?
No, it's just me trying to debug my latest program. Go on laugh, but I'll guarantee we've all done it,
and we'll all do it again.
Debugging can be a real pain. "But it worked just now!" "Why did it crash?" "The coding looks
perfect. I've checked it line by line 23 times." "There must be something wrong with my
computer."
This tutorial will start off by showing you some of the more common AutoLisp bugs that I've come
across, and then show you a couple of things to assist you in your debugging efforts. Let's start with
some common bugs.
The simplest and most common is yourself. I don't know if you are aware of the fact that most
programming errors occur between the seat and the keyboard. Yes, sad but true. So, how do we fix
you up? A couple of tips :
● Don't program or debug when you're tired. Walk away from it. Have a break, go shopping.
You'll be amazed at how a break from a program clears the mind.
● Very rarely will it be a computer or system bug. 99.99999 times out of a hundred, it's YOU.
● The computer or any other sinister source will not change your program coding or the
variable values therein. YOU DO.
The second type of bug is the syntax bug. A syntax bug is where the command is in error. For
example when you've miss-spelt an AutoLisp function or command. e.g. (setq ang1 (angl pt1 pt2))
This is normally quite easy to spot and rectify as AutoLisp will not recognise the command and
your program will stop.
Another VERY common syntax bug is naming variables after an AutoLisp function or command.
The most common? Angle and T ( angle and t ). I must have seen these two used as variables a
thousand times. Length (length) is another very common one.
The third type of bug is the logical bug. Now this little beastie has numerous faces and comes in all
shapes and forms.
The simplest form is when you pass incorrect information to a function.
(setq ang (angle pt1 pt2))
To test whether a variable is a number, use the same test as earlier but test for REAL or INT. You
can also use (numberp), which works the same as (listp) on lists. If the variable is a real number or
an integer, it returns T. If not, it returns nil.
To test for a positive or negative number use (minusp). This returns T if a number is negative and
nil if it is positive.
Oh, and before I forget, another good example of wrong data types is confusing radians with
degrees. AutoLisp functions use radians, AutoCAD commands expect degrees.
Loops are another area that seem extremely susceptible to attracting bugs. Have a look at this :
(while flag
(+ cntr 1)
( if ( = cntr 5)
);if
);while
What is supposed to happen here is that the program will loop until flag is set to nil. cntr is
supposed to be incremented by one at each loop. But, as you can see from this coding, (at least I
hope you can see), cntr will never reach the value of 5. It will always be equal to 1. The correct
coding should be :
(setq cntr (+ cntr 1))
System variables can also create untold problems, especially Snaps. Switch them On only when you
need them and Off once finished or you'll find yourself snapping to some weird and wonderful
parts of your drawing.
And please remember the golden rule. "Reset the system back to the way you found it." Before
changing system variables, save their existing values then reset them back at the end of your
program. And don't forget to to include these settings in your error traps so that if something
untoward does happen, your error trap will reset them back to their original values.
I was told that every time the user clicked the "Cancel" button, AutoCAD would freeze. Any idea
why? The second example has a similar error :
(action_tile
"accept"
"(progn
(setq rimel (get_tile \"ebrim\"))
The answer to both examples is that they were trying to call a function (exit) and (cutt) from
within a dialog.
In other words, the dialog was still open when they called the function.
An easy error to make and one to look out for.
When writing an AutoLisp routine it's quite handy to have the program stop if it encounters an
error. It's also nice to be able to view the variables whilst the program is running to ensure that
they contain the correct values.
In Visual Lisp and Visual Basic you can insert "breakpoints" into your coding that do just that and
use the Watch window to check on their values. If you are not using Visual Lisp or Visual Basic
this can still easily be accomplished. Place the following statement within your coding where you
would like your program to stop :
(setq bp (getstring))
This statement will stop your program and only continue once you hit the space bar.
To print the variables, put a (princ) statement to print the variable before the break point.
(princ variablename)
(setq bp (getstring))
(defun c:clay ()
(setq bp (getstring))
;loop
);repeat
(bpt)
(setq bp (getstring))
(princ)
);defun
(defun bpt ()
(princ i)
(princ "\n")
(princ n)
(princ "\n")
(princ sel)
(princ "\n")
(princ layern)
(princ "\n")
(princ layercol)
(princ "\n")
(princ i)
);defun
(princ)
Another good trick is to always make your variables "global" at the beginning of a program. If you
make them "local", they may have no value at the end of the program and you won't be able to see
what was in them. The same as for the breakpoints, remember to declare your variables as "local"
after debugging.
Leaving your variables "global" can though, create it's own problems whilst debugging. You run
various programs that use the same variable names and suddenly you find your variables
I also found this little tit bit at AcadX, which I'm sure they won't mind me sharing with you.
Prior to A2K, AutoLisp would dump a bug trace to the command line when an error was
encountered.
While developers went out of their way to suppress this behavior in a released product, it was a
handy tool during the debugging cycle. To get that same behavior in A2K, replace the standard
error handler with this one:
(defun errdump (s)
(vl-bt)
(princ)
Oh, and one more thing! Please remember the power of your eyes. Watch the screen as your
program runs. You can pick up a lot of clues from watching what happens to entities whilst your
program runs.
Well, that's it for debugging. I hope this helped you and didn't leave you even more frustrated than
before.
Remember, test, test, test and test.
If you would like to know how "NOT" to write your AutoLisp coding,
then check this out.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Since the dawn of times we've had at least 10 options to save private data with an AutoCAD drawing. Those
were and are the system variables USERI1-5 and USERR1-5 that holds integers and real numbers,
respectively. The idea is OK but the variables are exposed for everyone to use and you shouldn't assume
that your private data will stay intact.
Somewhere around release 10 came XData (Extended Entity Data) which is a rather clever invention. With
XData you can attach intelligent information to entities, and it works flawlessly. There aren't really
drawbacks to the technique, but there are limitations that has to do with the amount and type of data you
can attach.
During release 13 new forms of entities hit the deck in order to keep and maintain all sorts of data. Among
those were Dictionaries and XRecords. Like XData, Dictionaries can be attached to any kind of entity and
you can even attach XData to them. Additionally, with Dictionaries/Xrecords you can tell the drawing itself
to keep your data because the drawing maintains a dictionary in which you can save all the data you want.
So what is a Dictionary and how does it work? Instead of lengthy explanations, it'll be much easier to look
at one of the many Dictionaries that AutoCAD itself uses. Later we''ll briefly look at how to make our own
simple Dictionary, add an Xrecord to it and save them both with the drawing.
So, fire up AutoCAD and pay attention. As mentioned, the drawing maintains a Dictionary that is always
present. This is known as the 'named object dictionary' (although I prefer the term 'main dictionary'). In
VBA lingo it's a collection object and like all other collections it just holds a series of other objects. In VBA
it is accessed through the document object and in AutoLISP it's accessed by one function only,
NAMEDOBJDICT:
By looking at the entity list of the main Dictionary, the most important thing about Dictionaries becomes
clear: they are complete entities by themselves. They are not fragments of data attached to other entities
like XData are.
However, the Dictionary itself is not where you will store your raw data, - it is merely a container for other
objects that in turn can hold the data. The main dictionary above shows 5 such objects. Its components are
given by a unique name in group 3. Corresponding entity names are given by groups 350 that follow, but
when referencing an object in a Dictionary it should be done by name only. For example, to reference the
"ACAD_MLINESTYLE" object, use DICTSEARCH:
Now we are getting somewhere! All properties of the mline style "Standard" are exposed in all their glory.
Feel free to look up all properties in the DXF Reference. Want to change the color of multilines? Just
SUBSTitute group 62 and ENTMOD the style as usual:
Ok, so a Dictionary is a container that can hold a number of objects. Why not use existing structures like
symbol tables instead of complicating things? Many reasons, but two reasons come to mind. Symbol tables
are maintained by the people who implemented them and to expand them to hold every possible custom
object is not an option. Secondly, Dictionaries can be customized in a way that is not possible with symbol
tables, and that opens a range of possibilities only limited by imagination.
Dictionaries and XRecords go hand in hand. Like Dictionaries, XRecords are handled as named objects and
can be manipulated by the same functions that handle Dictionaries. In the following, we'll try to add our
own Dictionary to the main dictionary. We will also create an XRecord to hold various informations and
add it to our Dictionary.
When dealing with Dictionaries, at one point you will have to consider ownership. Which object is going to
own the Dictionary? Will it hold generic data for your application or will it hold data that is specific for
some entity or entities? In the first case you will probably use the main dictionary to save your data with the
drawing. If your application is maintaining data for linetypes, you will probably add an extension
dictionary to the linetype symbol table.
Whatever the ownership, the Dictionary is initially created without ownership and for that purpose we'll
use the function ENTMAKEX. It works like ENTMAKE, but it creates the entity without an owner - and it
returns an entity name instead of an entity list. Let's make a function that adds our own Dictionary to the
main dictionary. In this example we will name it "OUR_DICT":
;;if not present then create a new one and set the main
;; dictionary as owner
(progn
If you want to see what happens to the dictionary when added to an owner, then stop the routine right after
And there it is! But what good does it do us? It just sits there and doesn't hold any data. Well, let's say we
want to save data for a routine that creates annotations - for example a text style, a layer name and a text
height. Simple stuff, but it'll suffice for the purpose of illustration. With XRecords we can create an entity
that can hold any possible data within the range of defined data types. Unlike XData it uses regular group
codes to save data.
All group codes (except internal data like code 5 and the negative codes) can be used. Of course, the data
types that are defined for the specific group codes have to be respected. This means that, for example, a
code 70 cannot hold anything else than a 16-bit integer and so on. Code values can be examined in the DXF
Reference.
An XRecord is created in much the same way as a Dictionary. First we'll see if it already exists, then create
it without an owner with ENTMAKEX and lastly add it to our custom Dictionary. Again, we will name it in
order to retrieve it by name. In this example it will be called "OUR_DICT". Both name and initial values
are hardcoded into the function - in the real world we would probably make this a generic function and
specify name and values as arguments.
(cond
(cond
;;if it's already present then just return its entity name
(setq anXrec
Now we have an XRecord that contains three different data: a text style name in group code 7, a layer name
in group code 8 and a text height in group code 40. All codes are chosen with respect to normal convention,
but any code that can be associated with the data type in question can be used. The structure from which to
access our data will now be like this:
Named object dictionary = Dictionary (owner = the drawing)
> OUR_DICT = Dictionary (owner = named object dictionary)
> OUR_VARS = Xrecord (owner = OUR_DICT)
(7 . "Arial") = Egenskab i Xrecord
(8 . "A09-T-") = Egenskab i Xrecord
(40 . 2.0) = Egenskab i Xrecord
The only thing that remains is to read the data:
;;if our Xrecord is found, then get values in group code 7, 8 and 40
(cond (vars
(setq varlist (entget vars))
(setq txtstyle (cdr (assoc 7 varlist)))
(setq txtlayer (cdr (assoc 8 varlist)))
(setq txtsize (cdr (assoc 40 varlist)))
)
Because of the naming scheme, Dictionaries work much like symbol tables in terms of accessing entries. In
addition to DICTSEARCH there's also a function, DICTNEXT, to iterate through all entries in a
Dictionary. It works like TBLNEXT - here shown by iterating through the main dictionary:
(princ)
Command: listdicts
<Entity name: 185c0d0> (type = DICTIONARY)
<Entity name: 185f4b8> (type = DICTIONARY)
<Entity name: 185c0d8> (type = DICTIONARY)
<Entity name: 185f4a8> (type = ACDBDICTIONARYWDFLT)
<Entity name: 18c4320> (type = DICTIONARY)
<Entity name: 18c3d10> (type = XRECORD)
If you gained some understanding of Dictionaries and XRecords by now then I'll throw in a little
assignment: Figure out how you can add the XRecord directly to the main dictionary without first creating
a Dictionary!
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
When a new tool type is added to the system it will be added into the stock tool catalog and registered
with the system. Each app, including 3rd parties, will have their own stock tool catalog.
Here is what one of the stock tools in the AutoCAD stock catalog looks like:
<StockTool>
<ItemID idValue="{AF0F641B-9CCE-4474-8582-EFE0A38410FC}"/>
<Properties>
<ItemName src="AcTpCatalogRes.dll" resource="185"/>
</Properties>
<Source idValue="59a63456-0025-4ea0-9cb2-608916d5177c"/>
<Object>
<ComClass>
<CLSID idValue="{AF0F641B-9CCE-4474-8582-EFE0A38410FC}"/>
</ComClass>
<Module>
<File>AcTcTools.arx</File>
</Module>
</Object>
</StockTool>
ItemID: is a unique GUID for that tool type. Every instance of that tool type (e.g. Hatch Tool) will refer to
that stock tool by its GUID.
Properties: is that basic set of data you see when you look at the Tool Editor in the UI. In the above
case I believe the name of the tool type is in a resource dll for easy localization purposes, and then gets
created into the tool name you see for your locale. Of course when you manually rename a tool, that
name is saved instead for that instance. This dll also holds the default image for the tool.
The ComClass value is the GUID in your registry that points AutoCAD to the right dlls to actually run the
code for the tool.
Below is a typical stock tool from ADT. There are some similarities.
Tool Instance
Every tool in the system is unique. When you copy a tool through the UI it will be assigned a unique
GUID, or Item ID. Be careful just blindly cutting and pasting xml to create new tools. Either do it
through the UI or get a hold of a GUID generator program.
As for the Stock Tools, the <Properties/> node contains all the basic tool info that you assign from the
Tool Editor. Only those elements that are actually in use are written out.
Each time you copy a tool through the UI a unique image is created in the form <tool type>_<Tool
GUID>.ext. Since the image is auto-generated from the tool data it is really just a visual expression of
that data. So, if you manually specify several tools to point to the same image, don’t be surprised if
deleting one suddenly renders the others with a blank image. J
Image format: We chose to use PNGs because they have an alpha channel to support the tool images
having a transparent background. They are also a lossless compression format.
In the below example you will see how this tool instance refers to the StockTool. This is the same one
from above.
The <Data\> node is just that, all the data that you specify for that tool; in the example below it is all the
data to describe the solid fill Pantone hatch.
<Tool>
<ItemID idValue="{74CC8347-BEA2-46D7-B855-86700A2FD640}"/>
<Properties>
<ItemName>PANTONE 15-0525 TP</ItemName>
<Images>
<Image cx="32" cy="32" src="Images\Hatch
tool_8FC7645E-5F37-4200-8D7A-086354BBFB76.PNG"/>
<Image cx="64" cy="64" src="Images\Hatch
tool_8FC7645E-5F37-4200-8D7A-086354BBFB76 (1).PNG"/>
</Images>
<Description>Creates a solid fill hatch using PANTONE 15-0525 TP</Description>
<Time createdUniversalDateTime="2002-11-06T04:06:28"
modifiedUniversalDateTime="2002-11-06T04:06:28"/>
</Properties>
<Source/>
<StockToolRef idValue="{AF0F641B-9CCE-4474-8582-EFE0A38410FC}"/>
<Data>
<GeneralProperties>
<Color>
<BasicPropInfo>
<PropValue unspecified="FALSE" valueType="2" value="0"/>
</BasicPropInfo>
<CreateInfo>
<AcCmColor mRGB="3266557304">
<ColorName>PANTONE 15-0525 TP</ColorName>
<BookName>PANTONE(R) a & i-paper</BookName>
</AcCmColor>
</CreateInfo>
</Color>
<Layer>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="1"/>
</BasicPropInfo>
</Layer>
<Linetype>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="1"/>
</BasicPropInfo>
</Linetype>
<LinetypeScale>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="3" value="0"/>
</BasicPropInfo>
</LinetypeScale>
<PlotStyle>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="1"/>
</BasicPropInfo>
</PlotStyle>
<LineWeight>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="2" value="0"/>
</BasicPropInfo>
</LineWeight>
</GeneralProperties>
<Hatch>
<HatchType>Predefined</HatchType>
<PatternName>SOLID</PatternName>
<SourceFile>%INSTALL_DIR%\UserDataCache\Support\acad.pat</SourceFile>
<Angle>0</Angle>
<Scale>1</Scale>
<Spacing>1</Spacing>
<PenWidth>100</PenWidth>
<Double>0</Double>
<BlockExtent>0.5</BlockExtent>
</Hatch>
</Data>
</Tool>
Tool Palettes
Tool Palettes essentially have the same structure: a unique ItemID, a Properties node for the name/etc.,
and then all the tools contained on it.
<Palette>
<ItemID idValue="{EAAE2E08-02C4-4ABC-9B91-AF4C209CEAC9}"/>
<Properties>
<ItemName>General Drafting</ItemName>
<Images/>
<Description>This palette contains a sampling of basic 2D drafting tools</Description>
<Time createdUniversalDateTime="2002-11-06T21:45:34"
modifiedUniversalDateTime="2002-11-06T21:45:34"/>
</Properties>
<Source/>
<Tools>
<Tool>
<ItemID idValue="{2DDBB344-97D8-4085-84FD-1552F2F67430}"/>
<Properties>
<ItemName>PANTONE 8001 C</ItemName>
<Images>
<Image cx="32" cy="32" src="Images\Hatch
tool_FEDCC8B5-B55A-441D-8CA4-4720592B0494.PNG"/>
<Image cx="64" cy="64" src="Images\Hatch
tool_FEDCC8B5-B55A-441D-8CA4-4720592B0494 (1).PNG"/>
</Images>
<Description>Creates a solid fill hatch using PANTONE 8001 C</Description>
<Time createdUniversalDateTime="2002-11-06T04:06:28"
modifiedUniversalDateTime="2002-11-06T04:06:28"/>
</Properties>
<Source/>
<StockToolRef idValue="{AF0F641B-9CCE-4474-8582-EFE0A38410FC}"/>
<Data>
<GeneralProperties>
<Color>
<BasicPropInfo>
<PropValue unspecified="FALSE" valueType="2" value="0"/>
</BasicPropInfo>
<CreateInfo>
<AcCmColor mRGB="3263463287">
<ColorName>PANTONE 8001 C</ColorName>
<BookName>PANTONE(R) metallic coated</BookName>
</AcCmColor>
</CreateInfo>
</Color>
<Layer>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="1"/>
</BasicPropInfo>
</Layer>
<Linetype>
<BasicPropInfo>
<PropValue unspecified="TRUE" valueType="1"/>
</BasicPropInfo>
</Linetype>
- where to store the tools and palettes associated with that profile (WorkspaceCatalogPath)
- all the tool palettes associated with the Tool Palette Set
- current tab
- auto-hide state
All this allows you to set up Profiles where each user can be pointing to the same tool palettes, but each
user stores their own UI/personal preferences.
In the Options dialog under Files, you will see that you can change the location from which to
store/retrieve tool palettes from. One use-case would be a different profile for different projects, each
pointing to a unique folder in which to store your project-specific tool palettes.
You can also import a single tool or tool palette by dropping the .atc file from File Explorer.
Lastly, you can package tools and tool palettes in i-Drop packages and deliver them over the web. The
i-Drop object in your main html file would be something like:
</package>
Adding a New Tool Type
This aspect is probably beyond the main user group here, but there is also functionality in the 3rd Party
API’s that will allow 3rd Parties to create new tool types, which…can also be delivered via the web. The
process goes something like this:
1. User drops a tool from a 3rd Party’s website that is actual new functionality, in other words an
‘unregistered’ tool. All that is downloaded is the basic tool properties: name, image, etc. and a link to
an MSIEXEC file back on the vendor’s website.
2. AutoCAD will inform the user that it is a new tool and do they wish to install now or defer to later.
3. When they choose to install the new tool, the system will go download the MSI installer and install
the tool. Now that tool is registered with the tool system and part of the user’s stock tool catalog.
Any, that’s all. I hope this explains a bit more of the details and gets you all even more excited about
the possibilities ahead. J
Thanks –
Chris Yanchar
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Getting Started
Dialog Control Language, or DCL, always seems to frighten off a lot of Lispers. I admit, it did me too until I was
forced into a situation were I had to learn it and quickly. (make it work, or you're out boy!)
Well, I would hate for any of you to be in the same situation, so for the next few issues, I'll be taking you step by
step, hand in hand, through the minefield of the DCL language. I will share your pain and misery, and will wipe
away your tears, I will.....
("Hey Kenny, get on with it!")
Oops, sorry!
Anyway, where was I? Oh yeah, I will suffer.......(thump!!)
As I was saying before I got this black eye, there are a few terms that you need to familiarise yourself with
before we get stuck into some coding.
Firstly, the dialog box itself is known as a "dialog definition".
Secondly, each "control" on the dialog is known as a "tile definition".
Thirdly, each "property" of a "tile" is known as a dialog "attribute".
And fourthly, each "method" of a "tile" is known as an "action expression".
Why? Who knows? Who cares? All I know is that it will help you immensely in understanding the AutoCAD DCL
reference book if you have a basic knowledge of these terms.
Right, enough waffle, I'm bored and my eye's sore. Let's have a look at some DCL coding and design ourselves
a simple dialog box.
: dialog
{
label = "Test Dialog No 1";
: text
{
label = "This is a Test Message";
alignment = centered;
}
: button
{
key = "accept";
label = "Close";
is_default = true;
fixed_width = true;
alignment = centered;
}
}
//DCL CODING ENDS HERE
(defun C:TEST_DCL1 ()
(action_tile "accept"
"(done_dialog)"
);action_tile
(start_dialog)
(unload_dialog dcl_id)
(princ)
);defun
(princ)
;AUTOLISP CODING ENDS HERE
A very simple dialog box containing a message should appear on your screen. It did? Good, well done!!
(thunderous applause from the peanut gallery.)
test_dcl1
The name of the dialog.
: dialog
The start of the dialog definition
{
The opening bracket for the dialog definition
: text
The start of a text tile definition
alignment = centered;
The alignment attribute of the text tile
}
The closing bracket of the text tile
: button
The start of a button tile definition
{
The opening bracket for the button tile definition
key = "accept";
The key, or name of the button tile.
You will use this name to reference this button in your AutoLisp coding
label = "Close";
The label attribute. What appears on it.
is_default = true;
The default attribute. If this is true, this button will automatically be selected if the "Enter" button is pressed
fixed_width = true;
Forces the button to be just large enough for the label attribute
alignment = centered;
The alignment attribute
}
The closing bracket for the button tile
}
The closing bracket for the dialog definition
OK, that was easy hey? By the way, did you notice that each of the attribute lines finished with a semicolon? (;)
Another important thing that you must remember when dealing with attributes is that their values are case
sensitive. (e.g.. "True" does not equal "true".)
Now let's have a wee look at the AutoLisp coding that puts this whole thing together. Again, we'll take it line by
line :
(exit)
Exit the program if the dialog definition is not found.
);if
End if
(action_tile "accept"
If the user selects the tile who's name is "accept", then do the following :
"(done_dialog)"
);action_tile
End of action_tile
(start_dialog)
Start the dialog
(unload_dialog dcl_id)
Unload the dialog from memory
(princ)
finish clean
);defun
End of function
(princ)
Load clean
Many people get confused in regards to the order of AutoLisp statements when dealing with DCL files. I don't
blame 'em really. I mean look at the coding above!
● First we load the dialog file.
● Then we load the dialog definition.
● Then we run an action_tile statement.
● Then we start the dialog.
● And right after that, we unload the dialog.
Where's the logic in that?
Haha. But did you notice that the action_tile statement was quoted?
e.g.. "(done_dialog)".
"Remember this string, then pass it back to me when the user activates you."
"So, in other words, coding is pre-stored within a particular tile. When I select that tile the coding runs?"
Yep, that's it. But remember, no values will be returned until (done_dialog) is called, which is also quoted.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Home. Page I.
: dialog
: edit_box
{
label = "Enter Your Name :";
mnemonic = "N";
key = "name";
alignment = centered;
edit_limit = 30;
edit_width = 30;
}
: edit_box
{
label = "Enter Your Age :";
mnemonic = "A";
key = "age";
alignment = centered;
edit_limit = 3;
edit_width = 3;
value = "";
}
: button
{
key = "accept";
label = "OK";
is_default = true;
fixed_width = true;
alignment = centered;
}
: errtile
{
width = 34;
}
(start_dialog)
(unload_dialog dcl_id)
(princ)
);defun
-----------------------
(defun val1 ()
);defun
-------------------
(defun val2 ()
);defun
(princ)
The dialog that is displayed contains two edit boxes. One to enter your name into, and one your age. After
entering the relevant information select the "OK" button. An alert box will display showing your details.
Now run the program again, but do not enter your name. An error message will display informing you that you
must enter your name.
Fill in your name but leave your age blank. Press enter again. Another error message will inform you that you
have entered an invalid age.
Try it with a zero or a negative number. The same error message will display until you enter a number equal or
greater than 1. Both of these examples are know as validation.
:edit_box - This is a predefined tile that allows the user to enter or edit a single line of text.
There are a few new attributes defined in this tile :
mnemonic = "A"; - This defines the mnemonic character for the tile.
edit_limit = 3; - This limits the size of the edit box to 3 characters.
edit_width = 3; - This limits the user to typing a maximum of 3 characters.
value = ""; - This sets the intial value of the edit box, in this case nothing.
Now let's have a look at the AutoLisp coding. First the "action expressions".
(set_tile "name" "Enter Name Here") - This sets the runtime (initial) value of a tile who's "key" attribute is "name".
(mode_tile "name" 2) - This sets the mode of the tile who's "key" attribute is "name". In this example, we have
used a mode of "2" that allows for overwriting of what is already in the edit box.
(action_tile "name" "(setq name $value)") - Associates the specied tile with the action expression or call back
function. In this case we are saying "If the tile who's "key" attribute is "name" is selected, store the value of this
tile in the variable name."
(get_tile "name") - Retrieve the value of the tile who's "key" attribute is "name".
Instead of closing the dialog when OK is selected, we initiate a subroutine that checks (validates) that the name
information is exceptable. If it is not, the error tile is displayed.
(set_tile "error" "You must enter a name!")
Once the name has been validated, this routine then initiates a second subroutine that validates the age value.
If this not correct, the error tile is again displayed, this time with a different message.
(set_tile "error" "Invalid Age - Please Try Again!!")
If everything is correct, (done_dialog) is called, all values are returned and the alert box is displayed with the
relevant information.
Home. Page II.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
If you would rather call the dialog boxes from AutoCAD, I have included AutoLisp coding that will fulfill
this purpose in the download file that you can find at the end of this tutorial.
As well, explanations for all the tile attributes are covered in this section - "DCL Tile Attributes". I
suggest you refer to this whilst going through this tutorial.
Laying out a dialog is similar in way to writing a program. You don't start off by writing the whole
program in one go. You write the program in sections, testing each part as you go along. Only when
each part has been thoroughly tested, do you start to put the whole program together.
We are going to do exactly the same, splitting our dialog into 3 separate DCL files before merging them
all together into one.
We'll start off by creating a dialog with just two buttons, namely the "OK" and "Cancel" buttons. Open a
new file in the Visual Lisp editor and Copy and paste this.
afra : dialog {
label = "A" ;
: button {
label = "OK";
key = "accept";
mnemonic = "O";
alignment = centered;
width = 12;
is_default = true;
}
: button {
label = "Cancel";
key = "cancel";
mnemonic = "C";
alignment = centered;
width = 12;
}
Using the "Preview DCL in Editor" function, your dialog should look like this :
Did you notice something? The button layout "defaulted" to a column layout. But we need these two
buttons to be in a row! Ok, lets do that :
afra : dialog {
label = "A" ;
: row {
: button {
label = "OK";
key = "accept";
mnemonic = "O";
alignment = centered;
width = 12;
is_default = true;
}
: button {
A word of advice. Do not rely on your tiles to default to columns. Rather explicitly define a column
within your DCL Coding. If not? Well, confusion will reign......
Now we'll add the other four buttons to create our button cluster :
afra : dialog {
label = "A" ;
: column {
: row {
: button {
label = "OK";
key = "accept";
mnemonic = "O";
alignment = centered;
width = 12;
is_default = true;
}
: button {
label = "Cancel";
key = "cancel";
mnemonic = "C";
alignment = centered;
width = 12;
}
: row {
: button {
label = "Save";
key = "save";
mnemonic = "S";
alignment = centered;
width = 12;
}
: row {
: button {
label = "Help...";
key = "help";
mnemonic = "H";
alignment = centered;
width = 12;
}
: button {
label = "About...";
key = "About";
mnemonic = "H";
alignment = centered;
width = 12;
}
}
And, our dialog should now look like this :
Did you notice how only one of the button tiles has the "is_default" attribute set to "true"?
Good, you did! And why? Think about it!!!
For the sake of readability, and to save some space, you could also write the DCL coding like this :
afra : dialog {
label = "A" ;
: column {
: row {
: row {
: row {
}
On the next page we'll continue with our dialog.
Home Page II
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Select "DCL Source Files" from the "Files of Type" and then select your DCL file.
Select "OK"
Back to Tutorial
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Attributes in DCL define the layout and functionality of tiles. If you are familiar with Visual Basic,
you will find that they are very similar to properties.
DCL Attributes consist of a name and a value.
Note: The value of certain attributes can change at run-time, with user input or
'set_tile' calls.
The value of a tile's attribute must be one of the following type:
Integer
● Numeric Values (integer or real number) that represent distances such as width, or height of
a tile.
Real Number
● A fractional real number must have a leading digit.
e.g. 0.1 not .1.
Quoted String
● A quoted string consists of text enclosed in quotation marks (" "). Attribute values are case
sensitive. "RB1" is not the same as "rb1".
Reserved Word
● A reserved word is an identifier made up of alphanumeric characters, beginning with a letter.
e.g. true or false. Reserved words are case sensitive: True does not equal true.
Global Attributes.
Attribute :
● alignment
● fixed_height
● fixed_width
● height
● width
Applies To :
● All Tiles
● action
● is_enabled
● is_tab_stop
● key
● mnemonic
Applies To :
● button; edit_box; image_button; list_box; popup_list;
radio_button; slider; toggle; radio_column; radio_row.
● children_alignment
● children_fixed_height
● children_fixed_width
Applies To :
● row; column; radio_row; radio_column; boxed_row;
boxed_column; boxed_radio_row; boxed_radio_column.
● allow_accept
Applies To :
● edit_box; image_button; list_box
Attribute :
● aspect_ration
Applies To :
● image; image_button.
Attribute :
● big_increment
Applies To :
● slider.
Attribute :
● color
Applies To :
● image; image_button.
Attribute :
Applies To :
● edit_box.
Attribute :
● edit_width
Applies To :
● edit_box; popup_list.
Attribute :
● fixed_width_font
Applies To :
● edit_box; popup_list.
Attribute :
● initial_focus
Applies To :
● dialog.
Attribute :
● is_cancel
Applies To :
● button.
Attribute :
● is_default
Applies To :
● button.
Attribute :
● label
Applies To :
● boxed_row; boxed_column; boxed_radio_row;
boxed_radio_column; button; dialog; edit_box
list_box; popup_list; radio_button; text; toggle.
Attribute :
● layout
Applies To :
● slider.
Attribute :
● list
Applies To :
Attribute :
● max_value
Applies To :
● slider.
Attribute :
● min_value
Applies To :
● slider.
Attribute :
● multiple_select
Applies To :
● list_box.
Attribute :
● password_char
Applies To :
● edit_box.
Attribute :
● small_increment
Applies To :
● slider.
Attribute :
● tabs
Applies To :
● list_box; popup_list.
Attribute :
● tab_truncate
Applies To :
● list_box; popup_list
Attribute :
● value
Applies To :
● text; all active tiles (except buttons and
image_buttons).
To download all DCL and AutoLisp Code samples, stand up, go into the bathroom, look in the
mirror and stick your tongue out. Then return to the computer, place your mouse here, and click as
hard as you can. Enjoy..
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
alignment
Aligned Centered.
Aligned Right.
This attribute specifies the horizontal or vertical positioning of a tile within its cluster. If a tile is within a
column, the possible values are:
left, right or centered. (default: left)
If a tile is within a row, the possible values are:
top, bottom or centered. (default: centered)
You cannot specify the alignment along the long axis of a cluster. The first and last tiles in the cluster always
align themselves to the ends of the column or row.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
fixed_height
This attribute specifies whether a tiles height is allowed to fill the available white space. If this attribute is
true, the tile will be restricted to it's preset height attribute.
Possible values are: true or false. (default: false)
} //end row
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
fixed_width
This attribute specifies whether a tiles width is allowed to fill the available white
space. If this attribute is true, the tile will be restricted to it's preset width attribute.
Possible values are: true or false. (default = false)
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
height
This attribute specifies the height of tile. The height value must be an integer or a real number. The height
of image tiles and image buttons must be specified.
Note: The height of a tile is the MINIMUM value.
Possible values are platform dependent.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
width
This attribute specifies the width of tile. The width value must be an integer or a real value. The width of
image tiles and image buttons must be specified.
Note: The width of a tile is the MINIMUM value.
Possible values are platform dependent.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
action
This attribute specifies an AutoLisp expression to activate. The value must be quoted. eg. "(acad_colordlg 3)"
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
is_enabled
Enabled/Disabled.
} //end dialog
AutoLisp Coding:
(defun C:lisp49g ()
;define function
);not
(exit)
;exit if no dialog
);if
(action_tile "rb2"
"(mode_tile \"rb3\" 1)
(mode_tile \"rb4\" 1)
(mode_tile \"rb5\" 0)
(mode_tile \"rb6\"0)"
)
(action_tile "rb1"
"(mode_tile \"rb3\" 0)
(mode_tile \"rb4\" 0)
(mode_tile \"rb5\" 1)
(mode_tile \"rb6\" 1)"
)
(action_tile
);action tile
(action_tile
"cancel"
;if cancel button pressed
);action_tile
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;unload
(princ)
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
is_tab_stop
Tab Stops
This attribute specifies whether a tile is a tab stop. (receives keyboard focus when the user moves between
tiles by pressing the "Tab" key.) If a tile is disabled,
it isn't a tab stop even if this attribute is set to true.
If false, the tile is not a tab stop.
Possible values are: true or false. (default: true).
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
key
A List of Keys
This attribute specifies an ASCII name that your program uses to refer to a specific tile. It must be a quoted
string (no default) and is case sensitive.
("eb1" does not equal "Eb1").
Each key value MUST be unique within a dialogue definition.
} //end dialog
);not
(exit)
;exit if no dialog
);if
(mode_tile "eb1" 2)
(mode_tile "eb1" 3)
(action_tile "eb1"
;if this tile is selected
"(setq a $key)
;retrieve it's name
(action_tile "eb2"
;if this tile is selected
"(setq b $key)
;retrieve it's name
(set_tile \"eb5\" b)
;set the tile 'eb5' to it's name
(mode_tile a 1)"
;switch off the tile 'eb2'
(action_tile "eb3"
;if this tile is selected
"(setq c $key)
;retrieve it's name
(action_tile
"accept"
;if O.K. pressed
);action tile
(action_tile
"cancel"
;if cancel button pressed
);action_tile
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;unload
(if userclick
;if OK selected
);if
(princ)
);defun
(princ)
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
mnemonic
Mnemonic
This attribute specifies a keyboard mnemonic character for a tile. The mnemonic character is underlined in
the tile's label. The value is a quoted string of a single character that must be one of the letters of the tile's
label. (No default).
The character does not have to be unique to the dialogue box. If more that one tile has the same mnemonic,
you press Tab to cycle through the tiles sequentially.
The label attribute can also specify a mnemonic by preceding a character with an ampersand: (&).
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
children_alignment
Aligned Center
This attribute specifies the default alignment for all tiles in a cluster.
It does not override a child's alignment attribute if that is set.
Possible values for columns are left; right or centered.
default: left
Possible values for rows are top; bottom or centered.
default: centered
} //end column
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
children_fixed_height
This attribute specifies the default height for all the tiles in a cluster.
It does not override a child's height attribute if it is specified. Possible values are: true or false. (default:
false)
} //end row
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
children_fixed_width
This attribute specifies the default width for all the tiles in a cluster.
It does not override a child's width attribute if it is specified. Possible values are: true or false. (default: false)
} //end column
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
allow_accept
Allow_Accept.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
aspect_ratio
This attribute specifies the ratio of the width of an image to it's height. (width divided by height.) If zero
(0.0), the tile is fitted to the size of the image.
Possible values are floating-point values.
default: none.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
big_increment
Big Increment.
This attribute specifies the value that the slider will increase or decrease by, if you click the slider bar. This
value must be between the min_value, and the max_value.
Default value: One-tenth of the total range.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
color
Color.
} //end row
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
edit_limit
Edit Limit.
This attribute specifies the maximum number of characters a user is allowed to enter into an edit box.
Possible value is an integer.
Default: 132.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
edit_width
Edit Width.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
fixed_width_font
This attribute specifies whether a 'list_box' or 'popup_list' will display text in a fixed pitch font. This allows
for easier spacing and tab alignment of columns.
This attribute is valid only for Windows/NT.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
initial_focus
Initial Focus.
This attribute specifies the the key of the tile within the dialogue box that receives the initial focus when the
dialogue is started.
Possible value is a quoted string.
Default: None.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
is_cancel
Is_Cancel.
This attribute specifies whether the button is selected when the user presses
the cancel key (Esc or Ctrl+C). Possible values are true or false.
Default: false.
Only one button in a dialogue box can have the 'is_cancel' attribute set to true.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
is_default
Is_Default.
This attribute specifies whether the button is the default button selected ("pushed") when the user
presses the accept key. (normally "Enter").
Possible values are true or false.
Default: false.
Only one button in a dialogue box can have the 'is_default' attribute set to true.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
label
A couple of Labels.
This attribute specifies the the text displayed within tile. Possible value is a quoted string.
Default: A blank string, " ".
The label can specify the mnemonic for a tile by preceding one of the letters of
the label with the ampersand character. (&)
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
layout
Vertical Layout.
This attribute specifies the orientation of a slider. Possible values are horizontal
or vertical. For horizontal sliders, the value increases from left to right.
For vertical sliders, it increases from bottom to top.
Default : horizontal.
} //end column
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
list
This attribute specifies the initial set of lines (choices) to be placed in the 'popup_list' or 'list_box'. Possible
value is a quoted string.
Default : None.
Lines are separated by a new line symbol (\n). Tab characters (\t) can occur
within each line.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
max_value
This attribute specifies the upper range of values that a slider returns.
Default: 10000.
This value must be no greater than 32767.
} //end row
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
min_value
This attribute specifies the lower range of values that a slider returns.
Default: 0.
This value must be no less than -32767. The 'min_value' can be greater than the
'max_value'. This reverses the order in which these values appear on the screen. (Platform dependent).
} //end row
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
multiple_select
Multiple Select.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
password_char
Password Character.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
small_increment
Small Increment.
This attribute specifies the value that the slider will increase or decrease by, if you click the slider bar arrow
controls located at each end of the slider.
This value must be between the min_value, and the max_value.
Default value: One-hundredth of the total range.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
tabs
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
tab_truncate
This attribute specifies whether the text in a 'list_box' or 'popup_list' is truncated if it is larger than the
associated tab stop.
Possible values are true or false.
Default : false.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
value
Value.
This attribute specifies the initial value of a tile. Possible value is a quoted string. The meaning of a tile's
value varies depending on the kind of tile. The value of a tile can change at run-time, with user input or
'set_tile' calls.
} //end dialog
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
: column {
: row {
: row {
: text {label = " 1";}
: edit_box {key = eb1; width = 7; value = "000.000";}
: edit_box {key = eb1a; width = 7; value = "00.000";}
: edit_box {key = eb1b; width = 7; value = "000.000";}
: edit_box {key = eb1c; width = 7; value = "00.000";}
}
: row {
: text {label = " 2";}
: edit_box {key = eb2; width = 7; value = "000.000";}
: edit_box {key = eb2a; width = 7; value = "00.000";}
: edit_box {key = eb2b; width = 7; value = "000.000";}
: edit_box {key = eb2c; width = 7; value = "00.000";}
}
: row {
: text {label = " 3";}
: edit_box {key = eb3; width = 7; value = "000.000";}
: edit_box {key = eb3a; width = 7; value = "00.000";}
: edit_box {key = eb3b; width = 7; value = "000.000";}
: edit_box {key = eb3c; width = 7; value = "00.000";}
}
: row {
: text {label = " 4";}
: edit_box {key = eb4; width = 7; value = "000.000";}
: edit_box {key = eb4a; width = 7; value = "00.000";}
: edit_box {key = eb4b; width = 7; value = "000.000";}
: edit_box {key = eb4c; width = 7; value = "00.000";}
}
: row {
: text {label = " 5";}
: edit_box {key = eb5; width = 7; value = "000.000";}
: edit_box {key = eb5a; width = 7; value = "00.000";}
: edit_box {key = eb5b; width = 7; value = "000.000";}
: edit_box {key = eb5c; width = 7; value = "00.000";}
}
: row {
: text {label = " 6";}
: edit_box {key = eb6; width = 7; value = "000.000";}
: edit_box {key = eb6a; width = 7; value = "00.000";}
: edit_box {key = eb6b; width = 7; value = "000.000";}
: edit_box {key = eb6c; width = 7; value = "00.000";}
}
ok_only;
Did you notice how we where forced to include an "OK" button within the dialog?
Don't worry though, we'll remove that later.
Ok, on to the next section. Open a new file and add this coding :
afra2 : dialog {
label = "C" ;
: column {
ok_only;
}
Save this as "afra2.dcl" and then display it. It will look like this :
: column {
ok_only;
}
This will give us this :
The following coding is a merged version of the three dialog boxes that you have just created:
afralisp : dialog {
label = "Cross Section Level Information" ;
: row {
: boxed_column {
: row {
: row {
: text {label = " 1";}
: edit_box {key = eb1; width = 7; value = "000.000";}
: edit_box {key = eb1a; width = 7; value = "00.000";}
: edit_box {key = eb1b; width = 7; value = "000.000";}
: edit_box {key = eb1c; width = 7; value = "00.000";}
}
: row {
: text {label = " 2";}
: edit_box {key = eb2; width = 7; value = "000.000";}
: edit_box {key = eb2a; width = 7; value = "00.000";}
: edit_box {key = eb2b; width = 7; value = "000.000";}
: edit_box {key = eb2c; width = 7; value = "00.000";}
}
: row {
: boxed_column {
: row {
: row {
: row {
Ok, I admit that it's not exactly the same but it's as close as dammit.
You could, if you are that way inclined, mess around with boxed columns, boxed rows, and spacers, to get
a closer match, and if you feel the need, then go for it!!!
Me, I'm out of here to fetch myself a beer.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This tutorial will take you through all the steps of designing an AutoLISP routine with, a Dialogue Box Interface.
It will guide you through the coding of the DCL file, to the retrieval of the data from the Dialogue Box.
The dialogue box we will be designing will consist of the following :
● A Radio Column consisting of 6 Radio Buttons to allow the user to choose the type of bolt.
● An Image Tile.
Let's start with a very simple Dialogue Box containing simply, an OK button and a cancel button.
The dialogue box will look like this :
} //end dialog
Note the use of the predefined OK/Cancel tile. This is a standard tile set as defined in the AutoCAD Base. DCL
File. (You can refer to the AutoCAD Customization Manual for more examples.)
Now for the AutoLISP coding that calls the dialogue and handles each tile :
(defun C:samp1 () ;define function
);not
);if
(action_tile
"cancel" ;if cancel button pressed
(action_tile
"accept" ;if O.K. pressed
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);action tile
(princ)
);defun C:samp
(princ)
Let's add a paragraph of text to the dialogue. Only the DCL file changes here, the AutoLISP coding remains the
same except for the function name.
NOTE : //* preceding the comments denotes new coding :
} //*end paragraph
} //end dialog
And the coding remains the same except for name change :
(defun C:samp2 () ;define function
);not
);if
(action_tile
"cancel" ;if cancel button pressed
(action_tile
"accept" ;if O.K. pressed
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);action tile
(princ)
);defun C:samp
(princ)
Now we will add an image tile to make it look nice :
} //end paragraph
} //end row
} //end dialog
Because we haven't given the image tile a fixed height or a fixed width, it will expand or contract to suit the
available space. Now the AutoLISP coding :
(defun C:samp3 () ;define function
);not
);if
);setq
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile
"accept" ;if O.K. pressed
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);action tile
(princ)
);defun C:samp
(princ)
Note the following coding :
(setq w (dimx_tile "im") ;*get image tile width
h (dimy_tile "im") ;*get image tile height
This retrieves the width and height of the image tile and allocates them to variables w and h respectively.
The next code fragment uses these variables to "draw" the image tile.
The number "5" denotes the AutoCAD colour "Blue" :
(start_image "im") ;*start the image
(fill_image 0 0 w h 5) ;*fill it with blue
(end_image) ;*end image
Home. Page II. Page III. Page IV.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
} //end paragraph
} //end row
} //end dialog
And the AutoLISP coding :
(defun C:samp4 () ;define function
);not
);if
);setq
(action_tile
(action_tile
"accept" ;if O.K. pressed
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);action tile
(princ)
);defun C:samp
(princ)
Now we'll add a drop down list so that we can select the bolt size.
} //*end row
} //end paragraph
} //end row
} //end dialog
Note how we have put the Radio Column and the Drop Down List box into a Row. Looks good hey....Now the
AutoLISP coding :
(defun C:samp5 () ;define function
);not
);if
);setq
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile
"accept" ;if O.K. pressed
(strcat ;string 'em together
"(progn
(setq SIZ (atof (get_tile \"selections\")))" ;*get list selection
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);strcat
);action tile
);progn
);if userclick
(princ)
);defun C:samp
(princ)
Page I. Home. Page III. Page IV.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
} //end row
} //end paragraph
} //end dialog
And now the AutoLISP coding :
(defun C:samp6 () ;define function
);not
);if
);setq
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile
"accept" ;if O.K. pressed
(strcat ;string 'em together
"(progn
(setq SIZ (atof (get_tile \"selections\")))" ;get list selection
"(setq lngth (atof (get_tile \"eb1\")))" ;*get slot length
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);strcat
);action tile
);progn
);if userclick
(princ)
);defun C:samp
(princ)
Now, for the fun of it, let's add some toggles :
} //end row
} //end paragraph
http://www.afralisp.com/lispa/lisp73.htm (9 of 13) [23/03/2005 05:53:52 p.m.]
Dialog Boxes III
} //end row
} //end dialog
And now the AutoLISP coding :
(defun C:samp7 () ;define function
);not
);if
);setq
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile
http://www.afralisp.com/lispa/lisp73.htm (11 of 13) [23/03/2005 05:53:52 p.m.]
Dialog Boxes III
"accept" ;if O.K. pressed
(strcat ;string 'em together
"(progn
(setq SIZ (atof (get_tile \"selections\")))" ;get list selection
"(setq lngth (atof (get_tile \"eb1\")))" ;get slot length
"(setvar \"orthomode\" (atoi orth))" ;*ortho on/off
"(setvar \"snapmode\" (atoi sna))" ;*snap on/off
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);strcat
);action tile
);progn
);if userclick
(princ)
);defun C:samp
(princ)
Page I. Page II. Home. Page IV.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
} //end row
} //end paragraph
} //end row
} //end dialog
And Now the Complete AutoLISP coding :
(defun C:samp8 () ;define function
);not
);if
);setq
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile
"accept" ;if O.K. pressed
(strcat ;string 'em together
"(progn
(setq SIZ (atof (get_tile \"selections\")))" ;get list selection
"(setq lngth (atof (get_tile \"eb1\")))" ;get slot length
"(setq notes (get_tile \"eb2\"))" ;*get notes
"(setvar \"orthomode\" (atoi orth))" ;ortho on/off
"(setvar \"snapmode\" (atoi sna))" ;snap on/off
" (done_dialog)(setq userclick T))" ;close dialog, set flag
);strcat
);action tile
);progn
);if userclick
(princ)
);defun C:samp
(princ)
I have deliberately left all variables local, so that you can check their values at the command line.
That's it Folks....Enjoy your Dialogue Boxes..........
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
In this tutorial we are going to try to write a program that draws structural steel beams. The user will select
the size of beam from a list in a dialogue box. The data for the beam will then be retrieved from an external
data file. We will then draw the beam without touching our mouse or keyboard. (Pure Magic!!)
This is a complete working example of parametric programming.
First, lets start by writing the data file.
Create a file named BEAM.DAT containing the following :
You don't want to type? O.K. I'll be kind to you.
Click here for the source code - Beam.Zip (3 Kb)
**UNIVERSAL BEAMS DATA
**-----------------------
**H X B X T1 X T2 X R1
**-----------------------
*100x55x8
100.0,55.0,4.1,5.7,7.0
*120x64x10
120.0,64.0,4.4,6.3,7.0
*140x73x13
140.0,73.0,4.7,6.9,7.0
*160x82x16
160.0,82.0,5.0,7.4,9.0
*180x91x19
180.0,91.0,5.3,8.0,9.0
*200x100x22
200.0,100.0,5.6,8.5,12.0
*203x133x25
203.2,133.4,5.8,7.8,7.6
*203x133x30
206.8,133.8,6.3,9.6,7.6
*254x146x31
251.5,146.1,6.1,8.6,7.6
*254x146x37
256.0,146.4,6.4,10.9,7.6
*254x146x43
259.6,147.3,7.3,12.7,7.6
*305x102x25
**-------------------------
The first line (*100x55x8) is the name of the beam. (100 deep x 50 wide x 8 kg/m beam.)
The second line contains the physical dimensions that we need to draw the beam. (100.0,55.0,4.1,5.7,7.0)
(Height, width, web thickness, flange thickness and root radius.)
Next we need to write our DCL (Dialog Control Language) file.
Name this file BEAM.DCL. The coding is below :
beam : dialog { //dialog name
label = "Beams."; //dialog label
: list_box { //list box
label = "&Choose Section :"; //list box label
The third line displays a list box. This has it's own attributes :
A key attribute - This is the key that Autolisp uses to refer to the list.
Height - Simply the height of the box. If your list exceeds the height of the list box vertical scroll bars are
added.
Allow_accept - Instead of selecting an item from the list and then the OK
button, this allows you to select by double-clicking the list item.
The next section displays pre-constructed OK and Cancel buttons.
(Refer to the AutoCAD Customisation Manual for more examples of these.)
The last section is were you put your name, E-Mail address, Tel. Number, Thank You notes to me, etc.
Take note of were the { and } occur. DCL is very similar to AutoLISP in that what you open, you must close.
O.K Time for a rest and a cup of tea. (brantea!!)
What! Back already?
O.K. Now let us try and tie this lot together.
Time for the AutoLisp Coding. Ready, here we go :
;;;*=================================================================
;;;*======================================================
;;;*This section is covered in the External Data Tutor
;;;*======================================================
;;;*Format List
(if data
(progn
(setq maxs (strlen data)
count 1
chrct 1
);setq
(while (< count maxs)
(if (/= "," (substr data count 1))
(setq chrct (1+ chrct))
(setq numb (atof (substr data (1+ (- count chrct)) chrct))
dlist (append dlist (list numb))
chrct 1
;;;*========================================================
;;;*This section is covered in the Calculating Points Tutor
;;;*========================================================
The value returned by a list box tile is the INDEX of the selected item.
(i.e. first item = 0 ; second item = 1 ; third item = 2 ; etc.)
The action_tile function is one of the most critical functions to employ when giving your dialogue box some
functionality.
On it's own a DCL definition does nothing more than define a lifeless dialogue box. Take a look at the
following code :
(action_tile
"cancel" ;if cancel selected
"(done_dialog) (setq userclick1 nil)" ;close dialog, set flag
);action tile
Did you notice all the quotes around the lisp code? When you write an action_tile
function for a DCL tile, your code is esentially telling the tile :
"Remember this string, then pass it back to me when the user activates you."
The string (i.e Anything within double-quotation marks) is dormant until the user picks the tile that is
remembering your string. At that time the tile passes the string back to AutoLisp. AutoLisp then converts
the string to functioning code and the code is executed.
Lets look at another code fragment.
The following is the action_tile expression assigned to the OK button :
(action_tile
"accept" ;if OK or double click
(strcat
"(progn (setq SIZA (atof (get_tile \"selections\")))" ;get size of beam
"(done_dialog) (setq userclick1 T))" ;close dialog and set flag
);strcat
);action tile
When the user selects the OK button, the lengthy string assigned to the button is passed-back and turned
into AutoLisp code that looks like this :
(progn
(setq SIZA (atof (get_tile "selections")))
(done_dialog)
(setq userclick1 T)
);
This code does several things :
It retrieves the value of the INDEX from the list box.
It terminates the dialog box.
It assigns a value of T to the variable userclick1.
Now that everything is set and ready to go, we invoke the dialogue box.
(start_dialog)
Once it is on the screen, it controls the programme flow, until the user hits OK, Cancel or double-clicks on
an item in the list box.
(unload_dialog dcl_id)
The user has made his selection so now we can unload the dialogue box.
For the rest of the program we are back to conventional AutoLisp code.
(This is basically self explanatory, especially if you have studied my earlier tutorials.)
The program retrieves the name of the item selected from the list box by utilising
the index (SIZA) of the selected item and the nth function.
(setq SIZA (nth SIZA NAMES)).
It then searches the data file for the corresponding name, retrieves the list of dimensions, formats the list
then stores the dimensions into individual variables.
(mapcar 'set '(H B T1 T2 R1) dlist)
The points required to draw the beam are then calculated using the POLAR function and the beam is
drawn and rotated if required.
Notice how this section of the coding is contained in a while loop to allow the user to draw more than one
beam if he wishes. This saves him from having to re-run the entire routine again and again if he wants to
draw multiple, identical beams.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
To nest dialogue boxes is pretty straightforward. You simply call the new, nested dialogue box from
within an action expression or callback function.
For example :
(action_tile "next" "(nextfunction)")
This simply says that when the tile with the key of 'next' is selected, then run the function
(nextfunction). (nextfunction), of course, would have it's own dialogue statements.
Just a couple of comments on nesting dialogue boxes.
Firstly, you cannot use the previous dialogue box whilst a nested dialogue is
active. You must close the nested dialogue first.
And secondly, AutoCAD states that there is a limit of no more than eight nested
dialogue boxes allowed, but recommends a maximum of four.
(Try it, I haven't!!!)
Thirdly, try and keep each nested dialogue smaller than the preceding dialogue.
Here's an example of a function with a main dialogue box and two nested
dialogue boxes.
: column {
: text {
key = "txt1";
value = "This is the main dialogue box.";
}
: text {
key = "txt2";
: text {
key = "txt3";
value = "Press Next....";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Next";
key = "next";
width = 12;
fixed_width = true;
mnemonic = "N";
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
////////////////////////////////////////////////
nest1 : dialog {
label = "1st Nested Dialogue";
: column {
: text {
key = "txt1";
value = "This is the first nested dialogue box.";
}
: text {
key = "txt2";
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Next";
key = "next";
width = 12;
fixed_width = true;
mnemonic = "N";
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
////////////////////////////////////////////////
nest2 : dialog {
label = "2nd Nested Dialogue";
: column {
: text {
key = "txt1";
value = "This is the last nested dialogue box.";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
////////////////////////////////////////////////
And now the Autolisp Coding:
(defun c:nest ()
;define the function
(exit)
;if not loaded exit
(action_tile
"cancel"
"(done_dialog)
(setq result nil)"
)
;do this if Cancel button selected
(action_tile
"accept"
"(done_dialog)
(setq result T)"
)
;do this if OK button selected
(action_tile
"next"
"(nest1)"
)
;if Next button is selected, call
(start_dialog)
;start the dialogue
(unload_dialog dcl_id)
;unload the dialogue
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun nest1 ()
;define the function
(exit)
;if not loaded exit
(action_tile
"cancel"
"(done_dialog)
(setq result1 nil)"
)
;if cancel selected do this
(action_tile
"accept"
"(done_dialog)
(setq result1 T)"
)
;if OK selected do this
(action_tile
"next"
"(nest2)"
)
;if Next selected call the
;second nested dialogue function
(start_dialog)
;start the nested dialogue box
(unload_dialog dcl_id1)
;unload the nested dialogue box
(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun nest2 ()
;define the function
(exit)
;if not found exit
(action_tile
"cancel"
"(done_dialog)
(setq result2 nil)"
)
;do this if Cancel selected
(action_tile
"accept"
"(done_dialog)
(setq result2 T)"
)
;do this if OK selected
(start_dialog)
;start the second nested dialogue box
(unload_dialog dcl_id2)
;unload it
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ);load clean
See, pretty simple, hey....
Now, what you have all been waiting for....Hiding Dialogue Boxes!!!
(Sorry, but you will have to go to the next page.)
Hurry up, I'm waiting.....
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
Home. Page I.
This routine simply displays a dialogue box that asks the user for a point.
If the user choosers the pick point button the dialogue is hidden to allow the user to pick a point on
the screen. The dialogue is then re-displayed and the x, y and z edit boxes are updated to the new
point value. It also allows the user to
enter the point values directly into the edit boxes if he so wishes.
: boxed_column {
label = "Sample Point";
: edit_box {
key = "eb1";
label = "&X:";
width = 8;
fixed_width = true;
}
: edit_box {
key = "eb2";
label = "&Y:";
width = 8;
fixed_width = true;
}
: edit_box {
key = "eb3";
label = "&Z:";
width = 8;
fixed_width = true;
}
ok_cancel;
}
And now the AutoCAD Coding:
(defun c:hidebox ()
;define the function
(exit)
(mode_tile "eb1" 2)
;set focus to x edit box
(mode_tile "eb1" 3)
;select contents
(action_tile
"cancel"
"(done_dialog)
(setq result nil)"
)
;if Cancel button selected, close
;the dialogue. This action sets the
;flag to 0.
(action_tile
"accept"
"(setq ptx (get_tile \"eb1\"))
(setq pty (get_tile \"eb2\"))
(setq ptz (get_tile \"eb3\"))
(done_dialog)
(setq result T)"
)
;if OK button was selected, get the edit box
;point values, close the dialogue. This action
;sets the flag to 1.
(action_tile
"hide"
"(done_dialog 4)"
)
;if pick button selected, hide the dialogue
;and set the flag to 4
(if (= flag 4)
;if the pick button was selected
(progn
;do the following
);progn
);if
);while
(unload_dialog dcl_id)
;unload the dialogue
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ);load clean
To hide AND nest dialogue boxes is just a case of combining the two.
(I'll leave that up to you to figure out....)
Would you like the coding for these routines? Then put one leg in the air,
close your left eye, scream as loud as you can and click here. Enjoy.......
Home. Page I.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!
Home Lisp Tutors Newsletter EuroTech Rubbish Lisp Tips Links Privacy
VBA Tutors Daily Cartoon Books Downloads VBA Tips CAD Vault IntelliCAD
This library of AutoLisp Functions closely emulates the Visual Basic Message Box Function. It will
display 5 different types of message boxes and allows you to enter 3 text message lines and
customise the Message Box title.
The message boxes available are :
● Ok Only
● Ok Cancel
● Rentry Cancel
● Yes No
● Yes No Cancel
Ok Only.
Ok Cancel.
Rentry Cancel.
Yes No.
Yes No Cancel.
Source Coding.
Here is the DCL Source Coding:
lspOkCancel : dialog {
key = "main";
: column {
: text {
key = "message1";
}
: text {
key = "message2";
}
: text {
key = "message3";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
////////////////////////////////////////////////
lspYesNo : dialog {
key = "main";
: column {
: text {
key = "message1";
}
: text {
key = "message2";
}
: text {
key = "message3";
}
}
: row {
: spacer { width = 1; }
: button {
label = "Yes";
key = "yes";
width = 12;
fixed_width = true;
mnemonic = "Y";
is_default = true;
}
: button {
label = "No";
key = "no";
width = 12;
fixed_width = true;
mnemonic = "N";
is_cancel = true;
}
////////////////////////////////////////////
lspOkOnly : dialog {
key = "main";
: column {
: text {
key = "message1";
}
: text {
key = "message2";
}
: text {
key = "message3";
}
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
alignment = centered;
}
////////////////////////////////////////////////
lspYesNoCancel : dialog {
key = "main";
: column {
: text {
key = "message1";
}
: text {
key = "message2";
}
: text {
key = "message3";
}
}
: row {
: spacer { width = 1; }
: button {
label = "Yes";
key = "yes";
width = 12;
fixed_width = true;
mnemonic = "Y";
is_default = true;
}
: button {
label = "No";
key = "no";
width = 12;
fixed_width = true;
mnemonic = "N";
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
////////////////////////////////////////////
lspRentryCancel : dialog {
key = "main";
: column {
: text {
key = "message1";
}
: text {
key = "message2";
}
: text {
key = "message3";
}
}
: row {
: spacer { width = 1; }
: button {
label = "Rentry";
key = "rentry";
width = 12;
fixed_width = true;
mnemonic = "R";
is_default = true;
}
: button {
label = "Cancel";
key = "Cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
////////////////////////////////////////////
And the Autolisp Code:
(defun lspOkCancel (message1 message2 message3 main)
(action_tile
"cancel"
"(done_dialog)
(setq result nil)"
)
(action_tile
"accept"
"(done_dialog)
(setq result T)"
)
(start_dialog)
(unload_dialog dcl_id)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(action_tile
"no"
"(done_dialog)
(setq result \"F\")"
)
(action_tile
"yes"
"(done_dialog)
(setq result T)"
)
(start_dialog)
(unload_dialog dcl_id)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(action_tile
"yes"
"(done_dialog)"
)
(start_dialog)
(unload_dialog dcl_id)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(action_tile
"no"
"(done_dialog)
(setq result \"F\")"
)
(action_tile
"yes"
"(done_dialog)
(setq result T)"
)
(action_tile
"cancel"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(action_tile
"cancel"
"(done_dialog)
(setq result nil)"
)
(action_tile
"rentry"
"(done_dialog)
(setq result T)"
)
(start_dialog)
(unload_dialog dcl_id)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ)
If you would like the source coding for the the Message Box routine, just
place your mouse here, and click....Enjoy.
Search
Web afralisp.com
Be it hereby known that all the Coding and Tutorials contained on this here site, together with but not excluding all those other parts and utterances thereunto, shall not be warranted
against all defects, failures and malfunctions as shall occur between now and Thursday afternoon shortly before 2:00 am, during which time AfraLisp will maybe, at no charge to you or
the other person who was here before you, send the Coding or Tutorial to our Programmers, who will emerge from their caves and engage in rituals designed to cleanse the Coding or
Tutorial of evil spirits. This warranty does not cover attractive blonde females (not male) who may happen to visit this site or establishment or whatever you would like to call it.
Please respect the intellectual rights of others, or we will hunt you down and perform nasty things upon your body and appendages!!!