AnsweredAssumed Answered

Can't Display UV Curves of a Face as Wire Body

Question asked by Zhen Yan on Aug 15, 2018
Latest reply on Aug 15, 2018 by Zhen Yan

I want to use wire bodies to help me visualize some things while debugging and prototyping, but I can't seem to get the U/V curves on a surface to draw.

I basically prototype with macros (standalone add-in). Answers don't have to be language specific.


SldWorks sld = new SldWorks();
ModelDoc2 model = sld.ActiveDoc;
Modeler modeler = sld.GetModeler();
SelectionMgr sm = model.SelectionManager;

Face2 face = sm.GetSelectedObject6(1, -1); // picks the face
Surface surface = face.GetSurface();
double[] bounds = face.GetUVBounds();
double umin = bounds[0];
// don't know if copying is actually necessary
Curve curve = surface.MakeIsoCurve2(false, ref umin).Copy(); // I feel like the problem is here
Body2 wire = curve.CreateWireBody();
wire.Display3(model, Information.RGB(255, 255, 0), (int)swTempBodySelectOptions_e.swTempBodySelectable); // doesn't display


I've tried trimming it as well.

It normally works with most curves. I make a curve with Modeler, or grab an existing one, Curve::CreateWireBody(), Body2::Display(), and it should work, trimmed or untrimmed.