Loading second model

Everything DG Kernel: Technical discussions and issues
Post Reply
rocky35
Posts: 1
Joined: Thu Jul 11, 2024 9:16 pm

Loading second model

Post 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
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Loading second model

Post 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
Post Reply