Help to Modify Linexp.lsp to keep Layer, Color, line weight and Line Type

Help to Modify Linexp.lsp to keep Layer, Color, line weight and Line Type

Anonymous
Not applicable
4,288 Views
25 Replies
Message 1 of 26

Help to Modify Linexp.lsp to keep Layer, Color, line weight and Line Type

Anonymous
Not applicable

Hi again Family 🙂

I need some help with the Linexp.lsp. when exploded, It changes the custom Lines to color White and changes line weight to 0.00.

Is there a way to retain the original types when using Linexp.lsp?

The Line that i Linexp should stay at: Misc Layer, color bylayer, lineweight bylayer and Linetype name is GUY_CABLE.

Thank you sooooo much for any help if possible 🙂

0 Likes
Accepted solutions (1)
4,289 Views
25 Replies
Replies (25)
Message 2 of 26

dlanorh
Advisor
Advisor

It might be an idea to attach the lisp 👍

I am not one of the robots you're looking for

Message 3 of 26

Anonymous
Not applicable

my bad 🙂

see attached

0 Likes
Message 4 of 26

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

attached the fixed lisp. it will filter out all lines that have non continuous linetype but it does not scan blocks so be careful 😀

 

enjoy

moshe

 

 

Message 5 of 26

Anonymous
Not applicable

Hi @Moshe-A 🙂

Its does not lineX the Custom Guy_Cable line or Pline but it does makes rotated exploded arrays of the line/pline instead (Please See Attached DWG and also the capture for line properties :)).

 

Xploding The custom linetype attached in the DWG is what im looking for and to also retain set layers for the guy_cable its on before Exploding it with the LineX command lisp.

 

Thank you so much for all the help, its really appreciated!

 

0 Likes
Message 6 of 26

dlanorh
Advisor
Advisor
Your drawing/linetype references a shape file "guy.shx" which is external and missing.

I am not one of the robots you're looking for

Message 7 of 26

Anonymous
Not applicable

so sorry about that!

please see attached .shx file. thanks again for everything you guys do! this place with you guys = ROCK CITY! 🙂

0 Likes
Message 8 of 26

Moshe-A
Mentor
Mentor

what's the point in exploding linetypes???

0 Likes
Message 9 of 26

Moshe-A
Mentor
Mentor

what's the point in exploding linetypes?

Message 10 of 26

Anonymous
Not applicable

Customer has asked. they reject loading our custom linetype so we have to explode it so it shows on there side. 

0 Likes
Message 11 of 26

dlanorh
Advisor
Advisor
Doesn't exploding a polyline to lines but retaining the LineType kind of defeat the whole issue as the line will still have the custom linetype. Perhaps you need to replace the linetype with something Autocad already has such as batting.

I am not one of the robots you're looking for

0 Likes
Message 12 of 26

Anonymous
Not applicable

sorry about that, i miss spoke about what i need.

i want to explode the custom linetype and have the properties after explode to be: layer_Misc, Color_bylayer, Lineweight_bylayer and linetype bylayer 

0 Likes
Message 13 of 26

dlanorh
Advisor
Advisor
My point was you don't need to explode anything, just change anything with the custom linetype to linetype bylayer. Once completed you should be able to purge the linetype.

I am not one of the robots you're looking for

0 Likes
Message 14 of 26

Anonymous
Not applicable

i have a macro that does what i need but its super slow. i think it would be a lot faster if i can get this created into a LSP routine. 

 

this is what the macro looks like

Macro Function below copied from autocad command line:

Command: LINEXP
Select lines to be EXPLODED: 1 found
1 object(s) have been exploded to lines.
The line objects have been placed on layer 0.
Command: select
Select objects: p
10 found
Select objects:
Command: CHPROP
10 found
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: c
New color [Truecolor/COlorbook] <7 (white)>: bylayer
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: la
Enter new layer name : misc
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: lt
Enter new linetype name : continuous
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: lw
Enter new lineweight : bylayer
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]:

0 Likes
Message 15 of 26

Anonymous
Not applicable

the custom line is special, if i change the linetype then the custom line will change also.

i need it to stay as is but exploded with layer-misc, color-bylayer, line-weight bylayer and after explode to be continuous.

 

previous post has a macro i use but its super slow and cannot be added to lisp routine as is. i need help to see how to make a lisp that does the same as the macro function

thanks again for all the support, you guys rock!!  

0 Likes
Message 16 of 26

dlanorh
Advisor
Advisor

You don't need to explode anything just replace entity linetypes

 

1. Type _properties on the command line.

2. In the top right hand corner select quick select

3. In dialog that pops up keep whole drawing and multiple, and from list select layer, then  =Equals from the drop down and then from the layer drop down select Misc as the layer. This selects everything on layer misc

 

4. Press Quick Select again and this time select linetype from the list, <> not Equals from the =Equals drop down and bylayer from the bottom drop down. You should now have a selection set of all lines, polylines etc in layer misc that are NOT set to by layer. In the properties window go to linetype which should say guy_cable or more than likely *varies*. Click on it and select bylayer. Close the dialog and type purge. Under linetype you should find guy_cable. select it and purge it. If it is not there then you have a line with this linetype with a block.

 

Admittedly your drawing only had two items but it took 20 seconds to do the whole thing. Much quicker than the time to rewrite a lisp, or load and run a lisp.

 

I am not one of the robots you're looking for

0 Likes
Message 17 of 26

dlanorh
Advisor
Advisor
The custom linetype is the problem, as the client won't accept it. So in one or more drawings you have to replace it. If you're worried save the drawing under a slightly different name, that way you retain a drawing with the custom linetype and one for the client without.

I am not one of the robots you're looking for

0 Likes
Message 18 of 26

Moshe-A
Mentor
Mentor

@Anonymous ,

 


@Anonymous wrote:

Customer has asked. they reject loading our custom linetype so we have to explode it so it shows on there side. 


why the customer reject, don't they work with AutoCAD? instead of wasting a lot of your time for exploding send the customer your shape file shx for that complex linetypes and tell them to save it in the same folder as you use.

 

that's remind me many years a go...a consultant guys were asking us to explode any attribute blocks + any xrefs and you know what was the reason? they had hard time in handling attributes value and xref - is that a good reason?!

 

moshe

 

 

 

0 Likes
Message 19 of 26

Anonymous
Not applicable

hi @Moshe-A 

yes, i totally agree with you. The customer is an international company with many employees which makes it hard to have everyone install the custom line we have.

 

can you point me in the direction for creating a lisp routine from the macro i copied below?

i really need some help in this, the macro does everything needed but its really slow 😞

 

Macro routine below:

Command: LINEXP
Select lines to be EXPLODED: 1 found
1 object(s) have been exploded to lines.
The line objects have been placed on layer 0.
Command: select
Select objects: p
10 found
Select objects:
Command: CHPROP
10 found
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: c
New color [Truecolor/COlorbook] <7 (white)>: bylayer
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: la
Enter new layer name : misc
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: lt
Enter new linetype name : continuous
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: lw
Enter new lineweight : bylayer
Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]:

 

0 Likes
Message 20 of 26

Anonymous
Not applicable

heres my stab at making the lisp...not working as desired 😞

i dont know what im doing wrong. please help 

 

copied from autocad command line:

Command: XPL
Select lines to be EXPLODED:
Select objects: 1 found
Select objects:
1 object(s) have been exploded to lines.
The line objects have been placed on layer 0.select
Select objects: previous 14 found
Select objects: chprop
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Group/Add/Remove/Multiple/Previous/Undo/AUto/SIngle/SUbobject/Object
Function cancelled
Select objects: *Cancel*

0 Likes