Page 1 of 1

Loading second model

Posted: Thu Jul 11, 2024 9:20 pm
by rocky35
Hi
I am completely new to the software.
I need to add an object from an .stl file to my model I built. Is there a quick way to do that?
I am using dgk 7.1 with VB in Visual Studio 2022

Thank you

Re: Loading second model

Posted: Sun Jul 14, 2024 3:25 am
by Prashant Kande
Hello
Sure.
You need to create another model, load the file and add the entities you need to the main (control's) model.

Code: Select all

Dim iModelStandalone As IModel_DG = gen.Create(Of IModel_DG)
iModelStandalone.Load(path)
Dim iEntArray As IEntityArray_DG = iModelStandalone.GetEntityArray(False)
Dim iModel As IModel_DG = m_dgkc.GetModel()		'The main one
iModel.Add(iEntArray, -1)
This is a snippet from VB\KernCADLib\ModelManager.vb used in DataFlow sample. Try debugging it first to see if it works for your file.

Regards