Script for Broken line

Script for Broken line

Anonymous
Not applicable
1,654 Views
6 Replies
Message 1 of 7

Script for Broken line

Anonymous
Not applicable

I need to write commands for creating Broken(dashed) lines using AutoCAD Scriptfile. Can anyone help me out how to write the command in script file? 

0 Likes
Accepted solutions (1)
1,655 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Xsk
0 Likes
Message 3 of 7

john.uhden
Mentor
Mentor
Accepted solution

Won't a dashed or hidden linetype work for you?  If not, then I am guessing that you need the lines and gaps to be of specific lengths, as though you were drawing paint stripes exactly.  Is that the case?  If yes, then how do you handle situations where the whole lengths can not be achieved?  For instance if the line (pen down) were 4 units and the gap (pen up) were 1 unit, then the total length would have to be either 5, 6, 10, 11, etc. in order for them to space out evenly.  Will this apply to arced segments as well, including polylines?  This could get slightly complicated, especially if a vertex were within a pen down length.

 

I am not aware of Scriptfile.  Is it not available anymore, or just won't work in newer AutoCAD releases?

John F. Uhden

0 Likes
Message 4 of 7

john.uhden
Mentor
Mentor

Come to think of it, once PLINEGEN came around, I think I created custom linetypes to make dashed paint lines using polylines.  They were never exact, but looked close enough for construction plans.

John F. Uhden

0 Likes
Message 5 of 7

Anonymous
Not applicable

Thanks for the information. 

I used Hidden lines. This is how i wrote the command in script file --

 

Linetype s HIDDEN
line 0,40 20,80 

Linetype s ByLayer

0 Likes
Message 6 of 7

john.uhden
Mentor
Mentor

I was never much for AutoCAD scripts, except as simple menu items.

John F. Uhden

0 Likes
Message 7 of 7

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... This is how i wrote the command in script file --

 

Linetype s HIDDEN
line 0,40 20,80 

Linetype s ByLayer


Another way you could do that, without changing the current linetype setting and therefore having to change it back, would be to draw the Line and then use CHPROP to change its LType to HIDDEN.

 

Kent Cooper, AIA
0 Likes