How to create lineset with customized linewidth and colorful highline show in 3D viewer in C#

I’m developing a geometry of lineset in C#, now lines can be created in 3D view, I want to set these lines to be colorful and highline (looks like snap guide lines, and frame axis line).

  1. There’s a LineWidth in Python(ref. Illustrating a path/spaghetti diagram - Layout Configuration - Visual Components - The Simulation Community), but I can’t find the LineWidth property to change in C#.
  2. Is there a way to change into gradient color ?

You must be using an old version of Visual Components because at least in VC 4.2.2 and newer the ILineSet interface has a LineWidth property.

And material seems to be per LineSet, meaning that per vertex colors are not supported. I also suspect that attempting to work around this by creating lots of linesets with different materials may result in poor performance.

Sorry to tell you, I’m using Kuka.SimPro v3.1.2 .
1.So this version can not supported line width customize in C#?
2.The gradient color is meant for revolve polyline or polishing line paths or component temperature curve, some line set like that, I think. So Visual Components or SimPro don’t have gradient color for lineset ?

You can assign material to a line using API. The line does not support gradient. So one alternative is to have several line sets and each set would have to be given the needed material.

Another approach to consider is creating 3D overlay using linear gradient brush, but that is something you have to develop and manage.

Hi, I changed the lineset linewidth with python script as show below and lines can be seen in the 3D view.

But somehow when I save the vcmx file and reopen it, the lines width reset to default value and almost invisible. How to save the line width to vcmx file ?

Did you change some lineset from the node’s geometry or from a geometry feature? Cause if it was from the node’s geometry that information is not persistent, it is gone when a rebuild is made.

Yes, I changed line width with codes blew:

def setLineWidthOfComponet():
  for child in comp.Children:
    for x in child.Geometry.GeometrySets:
      if x.Type==VC_COMPACTLINESET:

Then how to save the width to the node’s geometry permanently? Or how to revise the width after rebuilding ?

It is a known limitation that the line width is not saved with simulation layout. Lines are mainly used as temporary geometry to highlight something on interaction or during simulation so persisting the line width in saved files has never been implemented.