Notifications
Clear all

[Closed] Dotted polyline with MaxScript?

Hi,
I’m drawing solid lines into the viewport using the gw.polyline method. But they are not really visible when the background in the scene has the same color as the lines. Is there a way to draw dotted or dashed lines instead?

Regards,
Christian

6 Replies

Surely a dotted line would have the same problem that you can’t see it?

You could set the colour of the line to the opposite of the viewport:


gw.setColor #line ((color 255 255 255) - (((GetUIColor 41) * 255) as color))

1 Reply
(@mrsparkle)
Joined: 11 months ago

Posts: 0

I could draw a solid black line and on top of it a dotted white line.

In most cases, I draw on objects. So it would depend on the object’s color, not on the viewport’s. Anyway, your approach would draw a gray line if the viewport is gray, so don’t use it

Haha! Whoops I completely missed that. Teaches me for replying without checking it in max

As far as I’m aware you can only get a solid line with gw. To get a dotted line you’ll probably have to utilise dotNet GDI+, and paint the lines onto a transparent form positioned over the viewport.

yes. draw dots or multiple short lines instead of one solid line

Interesting. Would potentially hundreds of tiny lines have a noticable impact on performance?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

not really. it impacts to performance but not badly.