Hi
I have tried to move/rotate object by detaching it. For some reason when I use detach function of Isection2, the detached object, instead of appearing as the last top level object, it actually get deleted. I don’t know if I am doing anything wrong, just wanted to check if anybody else reported it.
Thank you
Ibi
ISection2.Detach() not working
Re: ISection2.Detach() not working
Hi Ibi
The documentation was wrong. The detached section remains standalone. It will be alive for any operations until you release the last reference to it
You can add it to the model using IModel2.Add() as below.
Thank you for reporting. We did not realise it was never used in samples.
Private Sub OnDetach(sender As Object, e As EventArgs) Handles buttonDetach.Click
Dim iMod As IModel = AxKernCADnet1.GetModel
Dim iSectCone As ISection = iMod.GetSection(1)
Dim iSectSphere As ISection = iSectCone.GetChild(0)
Dim iSect2Sphere As ISection2 = iSectSphere
iSect2Sphere.Detach()
Dim iMod2 As IModel2 = iMod
iMod2.Add(iSect2Sphere)
End Sub
Regards
The documentation was wrong. The detached section remains standalone. It will be alive for any operations until you release the last reference to it
You can add it to the model using IModel2.Add() as below.
Thank you for reporting. We did not realise it was never used in samples.
Private Sub OnDetach(sender As Object, e As EventArgs) Handles buttonDetach.Click
Dim iMod As IModel = AxKernCADnet1.GetModel
Dim iSectCone As ISection = iMod.GetSection(1)
Dim iSectSphere As ISection = iSectCone.GetChild(0)
Dim iSect2Sphere As ISection2 = iSectSphere
iSect2Sphere.Detach()
Dim iMod2 As IModel2 = iMod
iMod2.Add(iSect2Sphere)
End Sub
Regards