TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on September 30, 2019, 11:02:43 AM

Title: Create line styles with 3 lines
Post by: Lupo76 on September 30, 2019, 11:02:43 AM
Hello to all,
I need to create line styles consisting of 3 parallel lines in a *.lin file.
Is it possible to do this technically? Such as?

Unfortunately I cannot use the MLINE entities.

I hope for your help.
Thanks in advance.
Title: Re: Create line styles with 3 lines
Post by: 57gmc on September 30, 2019, 12:19:41 PM
Sorry, but no. You can only create a single line. You can use lisp to add multiple individual, parallel lines though. I still have the old Express Tools DLINE.LSP for creating double lines. Maybe you could modify it to create 3 lines.
Title: Re: Create line styles with 3 lines
Post by: ronjonp on September 30, 2019, 12:52:12 PM
Why no mlines? You could draft with mlines then explode :)
Title: Re: Create line styles with 3 lines
Post by: ChrisCarlson on September 30, 2019, 02:31:48 PM
Your other option is to create a singe line, and perform a double offset via lisp.
Title: Re: Create line styles with 3 lines
Post by: roy_043 on September 30, 2019, 03:44:34 PM
You can do something with the TRACK1 shape. But there will be issues with endpoints, curves, and polylines.
Code: [Select]
*TRIPPLE,Tripple
A,1,[TRACK1,ltypeshp.shx,s=0.5,r=90,y=0.5],0,[TRACK1,ltypeshp.shx,s=0.5,r=90,y=-0.5]
Title: Re: Create line styles with 3 lines
Post by: Lupo76 on October 01, 2019, 09:27:24 AM
Thank you all for the answers and sorry for my delay.

Unfortunately, I think the only way to get what I need is to develop a lisp from scratch with the reactors to allow the 3 lines to be updated, changing only the central one.
I cannot use the MLINE because they cannot contain arcs, moreover their management lisp would certainly be more complicated than the polylines.

I had already tried the solution of @ roy_043 but unfortunately the problem in the final points is not acceptable in my context.
I just tried the DLINE.LSP and it could be a starting point for my work.

Thanks again for your support.

Title: Re: Create line styles with 3 lines
Post by: Lee Mac on October 01, 2019, 11:29:15 AM
To offer an alternative: you could construct standard LWPolylines (using arcs as necessary) representing the centrelines, and then use my Double Offset (http://lee-mac.com/doubleoffset.html) program to convert one into three. This presents a solution using existing tools, but the operation of performing a double offset could be streamlined and also implemented using a Reactor if required.
Title: Re: Create line styles with 3 lines
Post by: Lupo76 on October 02, 2019, 02:21:27 AM
To offer an alternative: you could construct standard LWPolylines (using arcs as necessary) representing the centrelines, and then use my Double Offset (http://lee-mac.com/doubleoffset.html) program to convert one into three. This presents a solution using existing tools, but the operation of performing a double offset could be streamlined and also implemented using a Reactor if required.

Yes exactly!
I'm going to do just what you suggested by adding a reactor so that when the user changes the axis the 2 parallel polylines are automatically recreated.

Thanks
Title: Re: Create line styles with 3 lines
Post by: Pepe on October 02, 2019, 12:46:09 PM
Hi...

If you want to explore some other ways, here's a funny one in C#...

https://www.keanw.com/2009/08/a-simple-overrule-to-change-the-way-autocad-lines-are-displayed-using-net.html

It isn't very difficult to change the code to show parallel lines, but you'll need to keep the DLL loaded all the time and call the Command for each drawing where you want this happen.
Title: Re: Create line styles with 3 lines
Post by: BIGAL on October 02, 2019, 11:00:46 PM
Lee-macs with a reactor sounds good, I did a as many as needed offsets, it just use csv input -3,3,-5,5 would draw 4 lines 3,4,5 draws 3 at the offsets indicated the -ve implies go left not right.