Wednesday, December 10, 2008

To Select only NUMERIC text/s

Sorry for a long gap. Actually I was out-of-station.

Here I come up with select/filter option. Say for example:
In an electro-mechanical drawing we are working on a panel board schedule. In the schedule, ALL the numerical texts have to be rewritten.
We cannot select the numerical text data through the AutoCAD built-in FILTER command.

So I developed this lisp routine.
It will SELECT and HIGHLIGHT only the numerical TEXTs.

* SLCTNUMBTXT.lsp (2Kb)
This command will filter out only the NUMERICAL text/s.

Sequence of command lines for this routine:-

Command: NUMB
Select texts...

Download : SLCTNUMBTXT.lsp

Tuesday, September 9, 2008

Lighting Layout : 1-Unit from edge, 2-units in between

Have you ever worked on Electrical drawings, especially "Lighting Layout" drawing?
In a Lighting Layout drawing, the blocks representing the normal light will be placed in a room as ...
one unit from the edges of wall & two units in between them.
This is a common concept.

So a draftsman has to either calculate manually or either place a line touching both walls (towards the LENGTH or WIDTH) and then using AutoCAD builtin command DIVIDE, he can get the required points.
But, Its annoying to use a long procedure of dividing & putting/erasing the POINTS, Hence, I worked to develop a LISP routine.

So this LISP routine is actually ...
A command to DIVIDE a line/pline/arc in equal segments with 1-unit from both ends and 2-units in between segments.

* DIVIDE_ALTERNATE.LSP (2Kb)
This command will DIVIDE a line/pline/arc in equal segments with 1-unit from both ends and 2-units in between segments.

Sequence of command lines for this routine:-

Command: DVD
Pick LINE/PLINE/ARC:
Enter the number of POINTS:


Download : DIVIDE_ALTERNATE.LSP

Monday, September 8, 2008

How to SAVE x-y coordinates of a point

Here we have seen how to save a selection with our favorite name. How about saving a PICK POINT with a specified name?
Someone will think that whats the use of saving an specified x-y coordinate in a drawing session?
Ofcourse there is a need. Lets assume that in a large scale drawing, you have drawn a temporary object say line/circle/point for some reference. Later on you forget to erase that object & also forget the exact location of its placement. This single line command will SAVES the exact location point (x-y-z coordinates) which you can get back any time in the whole drawing session. Even after erasing the object placed temporary on that point, you can always get back the point just by entering
!pt
at "Specify point" prompt of any AutoCAD builtin command.

* GETPT.lsp (1Kb)
This command will save x-y-z coordinates of any specified point under the name PT.

Sequence of command lines for this routine:-

Command: GETPT
Pick point to SAVE its location :

Download : GETPT.lsp

Sunday, September 7, 2008

Attrib Replacement

As here I have mentioned about the necessity of replacing of two text entities as well as provided a LISP routine towards its solution.

For a typical AutoCAD drawing using blocks with Attribs, same problems of replacing texts some times occur where we have to replace one ATTRIB with the another.
For example, In an architectural floor plan layout, If someone uses a block with attrib for the room numbering, sometimes room numbers have to be replaced. An AutoCAD draftsman might use built-in AutoCAD command DDATTE, but he has to modify both or sometimes more than 2 Attribs.
Hence I developed a LISP routine for replacing Attribs so as to work fast.

* AttribReplace.lsp (2Kb)
This command replaces two attrib values of same type of a block.

Sequence of command lines for this routine:-

Command: ATTR
Select FIRST Attrib:
Select SECOND Attrib:
Select FIRST Attrib:

(The command work continuously till you Enter or press "Esc".)

Download : AttribReplace.lsp

Thursday, September 4, 2008

Change selected Texts Height to a source Text

After these two TEXT lisps (here & here), once again I am here with a new one on TEXT.

Sometimes we need to change the HEIGHT of a selection of TEXT entities, equal to that of a picked source TEXT.
Match properties command will do this, but this inbuilt AutoCAD command will change all the other properties like as color, layer etc.

So this LISP is here for you.
It will only change the HEIGHT of all selected texts same as the picked source TEXT.

* SAMETXHT.LSP (2Kb)
This command change the HEIGHT of a selection of TEXT entities, equal to that of a picked source TEXT.

Sequence of command lines for this routine:-

Command: STH
Select text to change its height:
Select objects:
Select string to match its height:


Download : SAMETXHT.LSP

Wednesday, September 3, 2008

Drawing a Quarter or Semi Circle

Want to make a closed QUARTER (of a CIRCLE) as POLYLINE?
and/or
Want to make a closed SEMI-CIRCLE as POLYLINE?
These may required as symbols of Electro Mechanical drawings.

This LISP will sure help you to get what you required just in 4-simple prompts.

* QSCircle.LSP (3Kb)
This command will draw a QUARTER CIRCLE or a SEMI CIRCLE as a POLYLINE object.

Sequence of command lines for this routine:-

Command: QSC
Quarter-circle/Semi-circle
:
Pick center of polyline circle...
Radius of circle is... <2.0> =
Specify rotation angle or [Copy/Reference] <270>:


Download : QSCircle.LSP

Rotating any entity in exact 90° direction

Just today, a friend of mine has asked me to make a LISP file for him from which he can able to rotate a single entity in the exact 90° direction and only when he picks it.
Its not so hard. We can use the "ROTATE" command inside the LISP file. And the entity is rotated with respect to the POINT where you picked it. Where as while using builtin AutoCAD command "ROTATE" a user has asked for 3 prompts, Select Objects + Base point + Rotation Angle.

* ROT90.lsp (1Kb)
This is a command for rotating any entity in exact 90° direction.

Sequence of command lines for this routine:-

Command: ROT90
Select object:

Download : ROT90.lsp

Tuesday, September 2, 2008

HIGHLIGHT the previous selected objects...

While working on modifying the drawing objects, one needs to HIGHLIGHT the previous selected objects so as to change their properties (such as LAYER, COLOR, LINETYPE etc.)
A normal drafter would simply give the command "SELECT" & when the "Select Objects" prompt came, he/she type "P"
& so goes the previous selected objects HIGHLIGHTed.

Its OK.
But .... How about getting the previous selected objects HIGHLIGHTED just by Entering a command name in the command-line?
So simple man.
Grab this LISP.

* HighlightObjs.lsp (1Kb)
This command HIGHLIGHTS the previous selected objects.

Sequence of command lines for this routine:-

Command: SEH

Download : HighlightObjs.lsp

SAVING a selection-set with your favorite name?

How about SAVING a selection-set with your favorite name?
In a drawing session, sometimes we need to save a selection of entities without using GROUP command, so that we can use this same selection later.
This small LISP routine fills up your requirement.

* SAVESET.lsp (1Kb)
This command SAVES a selection-set with your given name.

Sequence of command lines for this routine:-

Command: SVS
Type a name for this selection-set :
Select objects:


Download : SAVESET.lsp

Monday, September 1, 2008

Text Replacement ...!

While working on TEXT entities, I had forced to make several LISP routines. First I think its a complex job as TEXT includes alpha-numeric characters as well as in AutoCAD it is inserted as a single line TEXT & multi-line also.
But later on I got interest & still happy to make any kind of LISP related to TEXT.

In Electro Mechanical drawings, such as in "Panel-Board Schedules" more & more times a drafter has to replace one text value to another. What to do?
Some find it easy to EDIT them using DDEDIT. But what if we have a large no. of values to be replace with each other? Isn't it a trouble some & time wasting job?
So came this LISP routine.
Just pick one text & then other .... wow...
You can see the values will be replace instantly !!

* TextReplace.lsp (3Kb)
This command replaces two text objects.

Sequence of command lines for this routine:-

Command: TRP
Select FIRST text:
Select SECOND text:
Select FIRST text:

(The command work continuously till you "Enter" or press "Esc".)

Download : TextReplace.lsp

Saturday, August 30, 2008

LINE of given length and direction

This small routine will draw a LINE of given length in a given direction.

Sequence of command lines for this routine:-

Command: LLD
Pick Start point :
Show direction or Enter angle :
Enter distance :


;CODING STARTS HERE
(prompt "\nType LLD to run....")

(defun C:LLD (/ pt1 ang1 dis1 pt2)
(setq pt1 (getpoint "\nPick Start point :"))
(setq ang1 (getangle pt1 "\nShow direction or Enter angle : "))
(setq dis1 (getdist "\nEnter distance : "))
(setq pt2 (polar pt1 ang1 dis1))
(command "line" pt1 pt2 "")
(princ)
)
;CODING ENDS HERE


Save this as "LLD.lsp".

Friday, August 29, 2008

How to know the total number of any "text-value"?

Here I come up with another simple but interested routine.
Say you have a ground Floor plan of a commercial building in which you put a text with the value read as "SHOP" in all the rooms which are designated as SHOPs.

This routine will help you to find out the total number of shops in the drawing instantly. Just pick any text value of "SHOP". Within a milli-second, this routine will show you the total number of text entities placed in the whole drawing as "SHOP".
Howzat??
Isn't it good? Cheers.....!!

P.S.:
This selection will also saved thru out the drawing session. i.e. If you want to select all the texts (named as "SHOP") again, then just type
!V1
at the Select objects: prompt.


* TotalNoOfPickedTEXTs.lsp (1Kb)
This command finds out the total number of any picked TEXTVALUE.

Sequence of command lines for this routine:-

Command: TXTV
Pick text entity:

Download : TotalNoOfPickedTEXTs.lsp

Thursday, August 28, 2008

How to find "Modified Dimension" ?

Some times we want to know how many dimension entities in the drawing (or in a selection-set) have been modified?
Some times we want to select all of these "modified dimensions" and change them back to their original values.
All of us better know how to change them back to "original-value" i.e. we have to just replace"<>" to that modified value.
But ... but ....
how can we know that which dimension is modified & which is not?

Below you can find the required LISP file.

* FindoutModifiedDIMENSION.lsp (1Kb)
This command finds out modified DIMENSION value.

Sequence of command lines for this routine:-

Command: MDM
Select objects:

Download :
FindoutModifiedDIMENSION.lsp

Tuesday, August 26, 2008

Instant Erase ...!

ERASE all POINTs / NODEs

Some times an AutoCAD draftsman wants to erase all the "POINTs/NODEs" within a selection area or from whole drawing. It requires 2 separate commands...
  1. Filter out POINTs/NODEs from the whole drawing or from a selection area
  2. Applying the command ERASE

But the following single command will instantly erase "POINTs/NODEs" within a selection area or from whole drawing.

(Instead of POINT you can use any other entity type as required such as LINE, CIRCLE, TEXT etc. Please change the POINT to your required entity type in the coding below.)

;COMMAND = ESE

;CODING STARTS HERE
(prompt "\nType ESE to run....")

(defun C:ESE (/ sep)
(setq sep (SSGET '((0 . "POINT")) ))
(command "erase" sep "")
(princ)
)
;CODING ENDS HERE


Save this as "ESE.lsp".

Monday, August 25, 2008

AutoCAD plot stamp removed!

For the users of AutoCAD 2007 (& above), there have been a problem of finding a "plot stamp" as ...
PRODUCED BY AN AUTODESK EDUCATIONAL PRODUCT
added on all four edges of any print of any drawing if they are using Educational (Student and Faculty) version of AutoCAD.

This problem affects all the other drawings (which are not from "Educational version") i.e.

  • when we try to copy some entities from the "plot stamped" drawing
  • when we try to get a "plot stamped" drawing as an xref / block

I have tried hard to find its solution by trial & error as well as web searching.
Here is the solution, which I have found it very much useful & also I am using it continuously without facing any difficulty

First you must have 2 more versions of AutoCAD loaded in your computer. i.e.:
AutoCAD ver.2000
AutoCAD ver.14


Then follow the procedure below:
1. Save the drawing (from which you want to clear the "plot stamp") as an AutoCAD-2000 ver. drawing
2. Open this drawing in AutoCAD ver.2000
3. Save this as an AutoCAD ver.14 drawing
4. Open this in AutoCAD ver.14
5. Save it & close it.
6. Open it (or Save it) in any version of AutoCAD {other than EDUCATIONAL 2007 ver. } & print.

You will not find the "plot stamp" again !!

Another simple method is :

Save the drawing as "dxf" format, Open this dxf file in AutoCAD & then again save it as dwg format.

Friday, August 22, 2008

Filtering lines/Plines of given length

There is a line with an specified length (say 60cm) in a drawing which represents an "electricity light" symbol. Remember this is not a "block". And we have to count the total number of "light-symbol" with a given line-length of 60cm.
Ofcourse we can use FILTER command. But there is'nt any option in FILTER, to filter out the line with a given length.
So is this LISP... :)

* FILT2.lsp (2Kb)
This command filters Lines/Plines of given length.

Sequence of command lines for this routine:-

Command: FILLP
Pick source LINE/PLINE:
Select objects:


Download : FILT2.LSP

Wednesday, August 20, 2008

JOIN multiple LINES as a single PLINE

This command join any number of selected LINES as one PLINE.
COMMAND = JPL

;CODING STARTS HERE
(prompt "\nType JPL to run....")

(defun C:JPL (/ jsel)
(setq jsel (ssget))
(if (> (sslength jsel) 1)
(command "pedit" jsel "y" "j" jsel "" "x")
)
(princ)
)

;CODING ENDS HERE

Save this as "JPL.lsp".

Tuesday, August 12, 2008

AutoCAD Single line commands

AutoCAD One line short-cuts. Type these on command-prompt.

;Instant ERASE with crossing-window...
(COMMAND "ERASE" "SI" "AUTO" "c")(princ)

;FILLET with crossing-window...
(COMMAND "FILLET" "C")(princ)

;Sets FILLET radius to zero.
(COMMAND "FILLET" "R" "0")(princ)

;Rotate any object @ 90° from its pick point.
(setq rsel (entsel) rp1 (cadr rsel))(command "rotate" rsel "" rp1 "90")(princ)

;Break an ARC/LINE/PLINE in 2 pieces from its pick point.
(IF (< (GETVAR "OSMODE") 16384)(SETVAR "OSMODE" (+ (GETVAR "OSMODE") 16384)))(setq bsel (entsel) bp1 (cadr bsel))(command "break" bsel "F" bp1 "@")(princ)

;Saves a previous selection by name "s1". Type "!s1" (at Select Object prompt) to retrieve this selection set at any later time.
(setq s1 (ssget "p"))

;This command creates continuous hatching.
(setq ent (ssget))(command "hatch" "" "" "" ent "")(princ)

Saturday, July 12, 2008

A command matches the attribute values of a source block

Following is a routine which is commonly relates to BLOCK/ATTRIB objects of the drawing.
It is useful for modifying or manipulating the BLOCK/ATTRIB objects.

* ATTRIBM.lsp (2Kb)
This command matches the attribute values of a source block to all selected target blocks. (Source & Target blocks should be of same name!)

Sequence of command lines for this routine:-

Command: ATM
Pick SOURCE block entity:
Select blocks to change their ATT_VALUES...
Select objects:


Download : ATTRIBM.lsp

Wednesday, July 2, 2008

Privacy Policy

Privacy Policy for http://www.mylisps.com

The privacy of our visitors to http://www.mylisps.com is important to us.

At http://www.mylisps.com, we recognize that privacy of your personal information is important. Here is information on what types of personal information we receive and collect when you use and visit http://www.mylisps.com, and how we safeguard your information. We never sell your personal information to third parties.

Log Files
As with most other websites, we collect and use the data contained in log files. The information in the log files include your IP (internet protocol) address, your ISP (internet service provider, such as AOL or Shaw Cable), the browser you used to visit our site (such as Internet Explorer or Firefox), the time you visited our site and which pages you visited throughout our site.

Cookies and Web Beacons
We do use cookies to store information, such as your personal preferences when you visit our site. This could include only showing you a popup once in your visit, or the ability to login to some of our features, such as forums.

We also use third party advertisements on http://www.mylisps.com to support our site. Some of these advertisers may use technology such as cookies and web beacons when they advertise on our site, which will also send these advertisers (such as Google through the Google AdSense program) information including your IP address, your ISP , the browser you used to visit our site, and in some cases, whether you have Flash installed. This is generally used for geotargeting purposes (showing New York real estate ads to someone in New York, for example) or showing certain ads based on specific sites visited (such as showing cooking ads to someone who frequents cooking sites).

DoubleClick DART cookies
We also may use DART cookies for ad serving through Google’s DoubleClick, which places a cookie on your computer when you are browsing the web and visit a site using DoubleClick advertising (including some Google AdSense advertisements). This cookie is used to serve ads specific to you and your interests (”interest based targeting”). The ads served will be targeted based on your previous browsing history (For example, if you have been viewing sites about visiting Las Vegas, you may see Las Vegas hotel advertisements when viewing a non-related site, such as on a site about hockey). DART uses “non personally identifiable information”. It does NOT track personal information about you, such as your name, email address, physical address, telephone number, social security numbers, bank account numbers or credit card numbers. You can opt-out of this ad serving on all sites using this advertising by visiting http://www.doubleclick.com/privacy/dart_adserving.aspx

You can chose to disable or selectively turn off our cookies or third-party cookies in your browser settings, or by managing preferences in programs such as Norton Internet Security. However, this can affect how you are able to interact with our site as well as other websites. This could include the inability to login to services or programs, such as logging into forums or accounts.

Deleting cookies does not mean you are permanently opted out of any advertising program. Unless you have settings that disallow cookies, the next time you visit a site running the advertisements, a new cookie will be added.
AdSense Privacy Policy provided by spare articles

Tuesday, July 1, 2008

Welcome to my LISPs Drawer!

Welcome to Hyderabadi's LISPs Drawer!

All AutoLISP programs are custom built by me.
On this blog, you can find some of those AutoLISP routines which I have developed for the last few years.
I hope that these exclusive LISP routines work well for you as they have been for me.
All these lisp routines have been tested true with AutoCAD Rel.12 and onwards. You can also redesigned a particular LISP for its enhancement.

Before starting this Blog, I was writing for my space (named as "mylisps") on 20m.com. But due to a feeling of some kind of incosistency, I left that space & now I feel more comfortable with this own Blog of mine. Further more, I should declare that nothing except two or three routines have been copied from the previous site to this new blog. I have also DELETED all the previous data from that site!

A brief introduction to AutoLISP® :
Ref.: GIS in Practice, by:Marianna Zichar

AutoLISP® is a programming language which operates within AutoCAD® and designed for extending and customizing AutoCAD functionality. In short, AutoLISP is used for making AutoCAD shortcuts and timesavers. AutoCAD introduced AutoLISP as an application programming interface (API) in its Release 2.1, in the mid-1980s.
AutoLISP is actually based on the LISP programming language, whose origins date back to the late 1950s. LISP was originally designed for use in Artificial Intelligence (AI) applications, and is still the basis for many AI applications.


For a more comprehensive history of AutoLISP® & its advantages, please refer to this good book :
Using AutoLISP with AutoCAD

The policy of this Blog:
1. All the content (except for quotable Quotes) on this Blog is the original one created by myself.
2. All the LISP files distributed here (through keepandshare.com) have been developed by myself & not copied from some where else.
3. Whenever/wherever I mentioned some Quotes or some phrases regarding to AutoCAD® or AutoLISP®, I will definately give the real source.
4. This Blog's sole aim is to provide necessary or enhanced help to all those AutoCAD users who are interested to develop their speed & technical skills.
5. All the LISP files are provided here for free use, but if you want to distribute them through any online source, You are bound to give the reference of my blog.

Thanks for visiting my Blog. Have a nice stay.
You are always welcome to contact me at:
Mr. Syed : hyd2007[@]gmail.com