Hi everyone
in 3d sketch i placeD 10 points by giving x ,y and z values after that i connected each point by using line, and converted the sketch into weldments ,the total process i had done with vb.net. Now my question is i want to convert the each line into structural member ,i written code for converting into structural member but it is not working can any one post code how to convert the line into structural member
object myFeature = null;
myFeature = Part.FeatureManager.InsertWeldmentFeature();
StructuralMemberGroup Group1 = default(StructuralMemberGroup);
Group1 = FeatMgr.CreateStructuralMemberGroup();
SketchSegment[] segments1 = new SketchSegment[2];
StructuralMemberGroup[] GroupArray1 = new StructuralMemberGroup[1];
boolstatus = Part.Extension.SelectByID2("Line1@Sketch1", "EXTSKETCHSEGMENT", -0.1495427140733, 0.1133237194389, 0, false, 0, null, 0);
boolstatus = Part.Extension.SelectByID2("Line2@Sketch1", "EXTSKETCHSEGMENT", -0.1872393706766, 0.08238014634844, 0, true, 0, null, 0);
segments1[0] = (SketchSegment)SelMgr.GetSelectedObject6(1, 0);
segments1[1] = (SketchSegment)SelMgr.GetSelectedObject6(2, 0);
Group1.Segments = segments1;
Group1.Angle = 0.785714285714286;
//radians
Group1.ApplyCornerTreatment = true;
Group1.CornerTreatmentType = (int)swSolidworksWeldmentEndCondOptions_e.swEndConditionMiter;
Group1.MirrorProfile = true;
Group1.MirrorProfileAxis = (int)swMirrorProfileOrAlignmentAxis_e.swMirrorProfileOrAlignmentAxis_Vertical;
Group1.GapWithinGroup = 0.0127;
//meters
GroupArray1[0] = Group1;
myFeature = Part.FeatureManager.InsertStructuralWeldment4("C:\\Program Files\\SolidWorks Corp\\SolidWorks\\data\\weldment profiles\\ansi inch\\c channel\\3 x 5.sldlfp", 1, false, GroupArray1);
Part.ClearSelection2(true);
Regards
K.C
SolidworksApi macros