Accessing sections

Technical discussions
Post Reply
Claude
Posts: 23
Joined: Thu Jan 05, 2017 3:58 am

Accessing sections

Post by Claude »

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

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Accessing sections

Post by nickz »

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

Post Reply