AutoCAD Visual LISP / AutoLISP :: Converting Objects Of Certain Linetype To A New Layer

Oct 26, 2012

I would like converting all objects that has forced linetype to be on a linetype layer.

So if there are objects that have forced linetypes - dashed/hidden/phantom, etc., those entities would be moved to a linetype layer based on their forced linetype.   The entities would all be changed to color bylayer, linetype bylayer.

So if there is a rectangle that is sitting on an EQUIPMENT layer, the routine would put that rectangle on a new layer called DASHED and change its forced linetype to BYLAYER.

Lastly, once that's done, the next and final step is to locate a the existing layers with matching linetype - say, OBJECTS with DASHED as a linetype, and merging it to that layer.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Rename Layer And Change Linetype

Jun 24, 2009

I need to do three things in a LISP routine for around 200 drawings. First, I need rename lots of old layer to new standard layer name, like change layer name "CL-RAILWAY-0" to new layer name "CL-0".

Secondly, I need translate some layer to standard layer, like all the things on layer "CL-WATER-160" to layer "CL-0"

Last, change some linetype, like change linetype"CENTER" to "CENTERLINE". I can do all those things by "CHECKSTANDARD" manually, but I really need someway faster and easier.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Auto Change To Layer 0 And Linetype?

Mar 9, 2012

how to write a lisp that when i activate it, it will change all the objects in the drawings to be change to "Layer 0" and all linetypes "Dashed" change to be "hidden"...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Force Change Linetype And Layer To Preset Preference?

Mar 7, 2012

Is there any way with a click of a button by using LISP, it will change all the selected object to be changed to a pre-set layer...

Example, after i select a certain entities in a drawing, with LISP, it will change all the object to layer "0"?

Additionally, u also need it to change all selected entities that are in "dashed" linetype to be change to "hidden" linetype..

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Block Element To Layer 0 Without Changing Color / Linetype

Sep 3, 2013

I have too many blocks with specific layers inside.

develope lisp can change all to layer 0 but keep color and linetype as it is.

I will use this as a part of script to change multiple block.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Objects To New Layer Based On Their Present Layer

Jun 20, 2012

Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Objects On Layer 0 To Existing Layer PC Module

May 31, 2012

I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"

If possible also;

save the document close the document open next in directory run layer changer program again.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Objects Layer?

Feb 7, 2010

How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: New Layer For Selected Objects

Jan 1, 2014

I need a LISP that create a new layer and ask me for the name and the other properties (color,lw,lt..).

ask me if I want move the selected object for the new layer (yes is the default value)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects To Different Layer Is Slow

Nov 26, 2013

I find that the command to move objects to a different layers runs very slow in one of the drawing.  I want to find out what wrong with the drawing and how to speed things up.

I have a LISP program that batch processes a large number of drawings.  One of the step to process each drawing is to change the colors of some objects according to the status of the objects.  I do this by moving the objects to a later that has the right color.  So far the program only takes 2 to 4 minutes to process each drawing.  But the program takes close to 90 minutes to process one specific drawing.  I track down the problem has to do with the command that moves the objects to the right layer, like this:
 
(vl-cmdf "_.chprop" (ssget) "" "_layer" "ABC-Prod-Good-Pcs" "")

 This command takes a very long time to finish, like 40 minutes each time it runs (to move 1200+ objects), and the program needs to run it twice for a total of approximately 80 minutes.

Please note that the drawing itself is not the largest drawing, and it doesn't have the largest number of objects to be moved either.  It is close to the top-5 drawings in term of drawing size and the number of objects to be moved. I cannot say that the drawing size or the number of objects to be moved are the cause of the problem.

I tried to "speed up" by moving 200 objects incrementally.  That didn't work. I tried to "speed up" by moving 100 objects incrementally and saving the drawing after each 100 objects are moved.  That didn't work either; actually the speed is slightly slower than simply moving 1200+ objects all at once.

I don't know what to do.  I believe there may be something unusual about that drawing.  By the way, the reason why I choose to change color by moving objects to a different layer has to do with the fact that I have found this is the best way so far. I tried to change the color of the objects directly.  But I find that the color of some sub-parts of the objects are not changed (because their color is by-layer). That's why I choose to change color by moving objects to a different layer.

How I can check the drawing, any different way to change color that is better.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Colors Of All Objects In A Layer

May 30, 2013

Can I have a lisp to select all objects in the layer "Defpoints" (including model and paper space, and including objects inside blocks) and change the color of those objects to color 30?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete All Objects In All Layers Except One Layer?

Jul 29, 2013

lisp program to delete all objects in a drawing based on Layer excluding one layer objects.

in AutoCAD.

Example : I may have 10 layers in a drawings like 1 to 10. I need to delete all objects on 2 to 10 layers.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Disable Snap For Specific Objects Or Layer?

Nov 28, 2012

Is there a LISP code for disabling OSNAP for specific objects or layers?  An automatic disable for multileaders would be useful when fine tuning the text placement. Trouble is you need the snap for the leader end. Maybe you could disable the snap for the text grip only. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting Special Layer With Special Line Weight To Special Layer Name

Aug 9, 2013

i have line in the drawing that exists on layer A-Wall it has different lineweight 0.05 from true wall. Now usually my routine : i select this line and then select similar to convert it to layer glazing.

i need lisp that by one command convert the objects on layer A-wall with layer 0.05 only to glazing.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change VP Linetype

Nov 8, 2012

In our Structural department, we use a layer called S-35-WALL-LB to denote a load-bearing wall, and what the guys typically do when they are on the sheet showing the floor above, is dbl-clk the VP to activate model space, open the Layer Manager and change the VP linetype to HIDDEN to show the afore-mentioned loadbearing walls as walls under.

way to accomplish this through a viewport...but instead of using the Layer Manager, use a lisp routine I can link to a toolbar button where all the user has to do is dbl-clk the VP, press the toolbar button, and either it will convert the default VP linetype (continuous) for S-35-WALL-LB automatically, or get the user to select an object on that layer and it changes the whole lot?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Delete Linetype In Drawings

Nov 6, 2013

I have some drawing that contains PHANTOM2 linetype.

I can't delete this linetype from my drawings!

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Flipping Linetype Text

Jul 25, 2012

I draw a linetype in my file with text in it (HW), I need to flip the text (Not the line itself) ...how is this done?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Linetype From DWG File

Sep 12, 2013

I've got a linetype that's part of our autocad template file and has been for so long that nobody around here even knows where the original line file is.

I need to extract the linetype out so that I can make some minor modifications.  I did do a search and found a nifty lsp routine from Paul Turvill.  (Here's the thread that pointed me there:  [URL] ..........

I ran it and it SEEMED to work.  All the linetypes in the file it created look good EXCEPT for the one I needed to extract. That one looks like this in the line file:
 
*TREELINE,Series of arcs used to indicate tree drip lines
A,0.0001,-0.0001,

The linetype DOES display properly in the dwg file (meaning lines drawn using it look good).

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Color And Linetype Modified By VPLAYER

Nov 2, 2011

How can I get the color that a layer has assumed in an specific viewport, and the same for an specific Linetype when it changed with an VPLAYER command

I found a function LM:GetOverrideData ( layer / data )  ;; © Lee Mac 2010

but return me the same data if I hask about an specific layer in all vports, and in one of them the layer color is modified.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Retaining Wall Linetype

Jun 12, 2009

Linetype code that represents blocks in a retaining wall, lets say for instance Keystone type blocks?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Prevent Dots On End Of Custom Linetype?

Sep 15, 2011

I have a custom linetype that's just a series of arrows I want to use to show the flow of a ditch. I've played around with this thing for a while and have these dots at each end of the line that shows up when I print.

Is there any way to make this linetype without the dots at each end? the actual files for the line type.

FLOW.lin
*FLOW,A,0,-.002,.148519,[FLOW,FLOW.shx,s=1],-.449481

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Linetype With Double Lines

Aug 12, 2012

I want to know how to create linetype with double lines one rectangle empty and other with solid in autocad(i am using autocad 2004)I tried by express tools with command mkshape (and then makelinetype command) but it is coming without solid, is it possible in autocad by using Autolisp, see attached dwg, name is linetype_ds

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Shapes In Custom Linetype To Reside In Drawing

Sep 17, 2013

I have a client who requested some complex custom linetypes. (line - shape - line)

I built the shapes and stored them in my ltype.shp file, and compiled that to ltype.shx. Then I added the custom linetypes in my acad.lin file. So everything works on my machine with no problem. However, when I send the drawing to someone else, the linetype works, but the shapes are left out. My guess is that since her ltype.shx file does not contain my new shapes, the lines are just drawn without them.

Is there a way that I can have those linetypes, complete with shapes, ride along inside/embedded the dwg file?

And before you ask, no, it's not an option to provide the client with the shx file that contains these shapes. I'm one of many different people in many different companies that might work on these drawings in the future and there's just no way that they'll be able to send an shx file along with the drawing every time someone new needs to work on it.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Color And Linetype Of Xref Nested Entity

Aug 22, 2012

I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.

Code below...

x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData)
(if (setq Sel (nentsel "
Select object to change layers color and linetype: "))
(progn

[Code]...

HP Elitebook Workstation
Windows 7

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting XML / BMML To DCL

Sep 12, 2011

I have started using Balsamiq mockups [URL]...... for preparing mockups of dialog boxes

The one I have created below still needs tweeking. Creating DCL files from xml or html?

Balsamiq Mockups is really cool and worth checking out. The dialog boxes are saved as bmml files which is based on XML. I am keen to try to create a way to translate the bmml file to dcl.

Here is a sample of what the code looks like from a sample bmml file:

<mockup version="1.0" skin="sketch" measuredW="941" measuredH="169" mockupW="36" mockupH="40">
<controls>
<control
controlID="1" controlTypeID="com.balsamiq.mockups::CallOut" x="644"
[code].......

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting 2D Solid Into Hatch

Mar 26, 2012

I'm looking for a lisp routine which will 'convert' number of 2dsolid into hatch. Drawing contains dozens of 2dsolids (solids are on one layer, there are also other entities on this layer) which have different colors, have common verticies and edges. i.e. I want to kind of 'join' solids of the same color and convert them into one hatch colored as original solids and placed on existing layer (let it be layer '0' zero for now). Same color solids can exist in few locations - there is a case to make few separate hatches of the same color (all joined solids should be represented as 1 hatch, should not separate after separate hatch command). There is max of 20 different colors (all of them from ACI index). Solids are not crossing themself or other solids (just joining with 1 or 2 verticies).

There are also 2dsolids with 'zero-area' - represented as a line - those should be erased at the beginning (not to have a line-like hatch).

Example drawing attached.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting Polylines To 3d Polyines

Dec 12, 2011

I need to be able to convert "polylines" (as opposed to "2d polylines") to 3d polylines. Here is the issue: the polylines that I want to convert have object data attached to them and they are at the proper Z elevation. When I use the "Convert 2d to 3d polyline" function, the conversion does take place, but all of my object data is removed from the object. And since one of my attributes reflects the overall elevation of the object (which all of the verticies will be the same elevation - even though it will be a 3d polyline), there are too many objects to individually update the attribute information when I am pressed for time.I am working in Civil 3d 2010. Any way to do this using Civil 3d?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting MText To Multileader

Nov 19, 2013

I got this nice little lisp from [URL] .....
 
(defun c:mt2ml ( / oobj nobj nstrg) (vl-load-com) (setq oobj (vlax-ename->vla-object (car (nentsel "
Select source text: ")))) (if (= (vlax-get-property oobj 'ObjectName) "AcDbMText") (setq nstrg (vlax-get-property oobj 'TextString)) (exit) ) (command "_MLEADER") (while (= 1 (logand (getvar "CMDACTIVE") 1)) (command PAUSE)) (setq nobj (vlax-ename->vla-object (entlast))) (if (= (vlax-get-property nobj 'ObjectName) "AcDbMLeader") (vlax-put-property nobj 'TextString nstrg) (exit) ) (entdel (vlax-vla-object->ename oobj)) (princ))

It converts MText to a Multileader.

My goals would be as follows:
 
The multileader should end up on the same layer as the Mtext.  (Currently it uses the current layer.)The multileader should hold the same rotation as the Mtext. (Currently it goes to zero.)The multileader should be created in the same location as the Mtext, without the user having to click.  (Currently the multileader is created wherever the user clicks.)The multileader should be created without a leader.  We can add one afterwards if needed, but for many we don't need a leader.  (We're just using the object as mtext with a box around it.)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting Double To String Creates Inaccuracy?

Aug 6, 2013

I have this interresting problem, it occured just here, in other situations, the script works fine.

I am counting length from coordinates:

 Command: (setq bod1 ppo_bod1)(-0.821965 -1.7232 0.0)Command: (setq bod2 ppo_bod2)(25.428 13.1268 0.0)Command: !mfac0.025Command: (setq x (atoi (rtos(/ (abs (- (car bod2) (car bod1))) mfac))))1050Command: (setq y (atoi (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac))))593Command: (- (cadr bod2) (cadr bod1))14.85Command: (/ (abs (- (cadr bod2) (cadr bod1))) mfac)594.0Command: (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac))"593.99999998"Command: (atoi (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac)))593
 
As you can see, the conversion from 594.0 (real) to string causes an inaccuracy, which is strange, because the length really is 594.0

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Prevent Certain Object In Layer Change To New Layer Automatic?

Apr 17, 2012

lisp..It work fine but just that i need some minor modificatio to it...At moment, when i activate the lisp, it will automatic select all dimension,leader and multileader to a layer call "DIMENSION"...Anyway i wonder if it is possible to prevent any dimension,leader or multileader in layer "Section" will not be change to layer "Dimension"?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Link Xref Layer To Local Layer - Same Display

Feb 21, 2013

Possible to link an xref layer and local layer so they display the same (eg. sync viewport colour, linewieght, line type)?

I insert xref's for my base drawing but legend is on local layers and I would like to be able to ensure that the line colour and linetype always match...

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved