Good day
1) how do I add a new Section ? Simply with the KCadCreateSection(KernCadNet.EObjectType.eObjTypeMeshSection) ?
2) then, when I want to give color to each section, say 1 color for the first object, 1 color for the second, how do I access each section ? Seems neither IModel nor IModel2 offer access to individual sections.
Thanks
Accessing sections
Re: Accessing sections
Hello Claude,
1) how do I add a new Section ? Simply with the KCadCreateSection(KernCadNet.EObjectType.eObjTypeMeshSection) ?
Yes it should work. I did not see what is inside. It is your function. Just repeating what you did for the first one should create a new section with empty mesh. If you fill it with new data you will get another object. You might need to think about its location and orientation set via ISection>IFrame3 (or any IFrame*)
2) There is IModel.GetSection(index), which returns ISection. Samples have many examples of its use. You should not need it, but there is also: IModel>IArray(or IArray2)>GetItem(index)>CType or cast to ISection
Nick
1) how do I add a new Section ? Simply with the KCadCreateSection(KernCadNet.EObjectType.eObjTypeMeshSection) ?
Yes it should work. I did not see what is inside. It is your function. Just repeating what you did for the first one should create a new section with empty mesh. If you fill it with new data you will get another object. You might need to think about its location and orientation set via ISection>IFrame3 (or any IFrame*)
2) There is IModel.GetSection(index), which returns ISection. Samples have many examples of its use. You should not need it, but there is also: IModel>IArray(or IArray2)>GetItem(index)>CType or cast to ISection
Nick