Hello,
I'm working with 32bit VB6 and the KerCADe.ocx version (5549 I believe).
We have a button to swap between solid render and wireframe.
Previously we would use the KerCADcontrol.RenderSolid boolean, however this now gives an error.
I see there is a GetRenderSolid and SetRenderSolid in IControlInitialisationContext_DG. So far, I've been unable to properly initialize a IControlInitialisationContext_DG variable, not seeing any good way to generate it or derive it from the other class/structs...
Any tips for us?
RenderSolid in 7.2
-
- Posts: 86
- Joined: Tue Jun 18, 2024 6:12 am
Re: RenderSolid in 7.2
Hi
Sorry about that. We are looking into it.
Thanks for reporting.
Sorry about that. We are looking into it.
Thanks for reporting.
-
- Posts: 86
- Joined: Tue Jun 18, 2024 6:12 am
Re: RenderSolid in 7.2
I do not see it happening
RenderSolid should work. It is a very basic core functionality.
I have tried few v5.2 VB6 samples with 5553 and 5552. It seems to be OK.
5549 seems to have some build problem. Try the current 5553 please or an earlier update.
Regards
RenderSolid should work. It is a very basic core functionality.
I have tried few v5.2 VB6 samples with 5553 and 5552. It seems to be OK.
5549 seems to have some build problem. Try the current 5553 please or an earlier update.
Regards
-
- Posts: 86
- Joined: Tue Jun 18, 2024 6:12 am
Re: RenderSolid in 7.2
The most common way to define control properties (ModelPath, etc.) is using the designer. They can also be set at runtime. ControlInitialisationContext_DG is yet another, somewhat exotic in my view, way to of defining the properties. It was intended for the case when the control and/or the form are created programmatically at runtime, so there is no designer involved.
This is an overview: Initialisation Context (ActiveX), Initialisation Context (.NET)
C++ version of Shape Explore sample has an example.
This is an overview: Initialisation Context (ActiveX), Initialisation Context (.NET)
C++ version of Shape Explore sample has an example.
Re: RenderSolid in 7.2
Hi Prashant,
I am running v5555 now.
I am still having an issue calling RenderSolid = false when I have created a Mesh geometry in DG.
First, I load an IGES file. Then, from the IGES, we make a mesh using the following lines:
Note: IGES geometry is loaded into MyComponentEntity (As IEntity_DG)
MyModel3D (as IModel_DG) is derived from KernelCAD.GetModel
When I call RenderSolid = true, no issues.|
When I call RenderSolid = false, I get object disconnect errors and the IDE crashes along with the program.
I can share a driver project with you privately if needed.
-Adam
I am running v5555 now.
I am still having an issue calling RenderSolid = false when I have created a Mesh geometry in DG.
First, I load an IGES file. Then, from the IGES, we make a mesh using the following lines:
Note: IGES geometry is loaded into MyComponentEntity (As IEntity_DG)
MyModel3D (as IModel_DG) is derived from KernelCAD.GetModel
Code: Select all
'Mesh generation for sharper visualization
Dim blnAddMesh As Boolean, dblMeshResolution As Double, MyDictionary As IDictionary_DG
blnAddMesh = True
If blnAddMesh = True Then
'Set mesh resolution for appropriate visualization (KernelCAD range 0.001-1000)
dblMeshResolution = 0.1
Set MyDictionary = MyObjGen3D.Create("IDictionary_DG")
Call MyDictionary.SetDouble("Deviation", dblMeshResolution)
Call MyComponentEntity.SetGeometryTypeEx("Mesh", MyDictionary)
End If
' STEP 6 - add to main model and render
Call MyModel3D.AddEntity(MyComponentEntity)
When I call RenderSolid = false, I get object disconnect errors and the IDE crashes along with the program.
I can share a driver project with you privately if needed.
-Adam
-
- Posts: 86
- Joined: Tue Jun 18, 2024 6:12 am
Re: RenderSolid in 7.2
What works well is a small runnable test/demo similar to this. Try a simplest case first. Create an iges using a sample like DIView. In the Model Explorer delete all objects, create a box or rectangle (or IStdShape_DG.Rectangle() or Box()), save as iges. Create a new small app or modify a sample.
It serves as a proof, analysis, problem reduction, preliminary step for debugging, etc.
Cheers
It serves as a proof, analysis, problem reduction, preliminary step for debugging, etc.
Cheers
-
- Posts: 86
- Joined: Tue Jun 18, 2024 6:12 am
Re: RenderSolid in 7.2
I have added
to the IViewTest of the InterfaceTests.
In the base:
I do not get the problem.
Notice that SetGeometryTypeEx() modifies the entity in place. So, I do Clone() before that. The model explorer shows the initial structure and the new entity OK.
Code: Select all
public void RenderSolid_ForumT116()
{
base.Load("IGES\\Lens.iges");
int n = m_iModel.GetEntityCount(); Debug.Assert(n > 0);
IEntity_DG entity = m_iModel.GetEntityAt(0);
IEntity_DG entityNew = entity.Clone();
IDictionary_DG iDict = m_gen.Create<IDictionary_DG>();
iDict.SetDouble("Deviation", 0.1);
entityNew.SetGeometryTypeEx("Mesh", iDict);
m_iModel.AddEntity(entityNew);
m_dgkc.RenderSolid = true;
m_dgkc.RenderSolid = false;
m_iView.Reset(true, true);
}
In the base:
Code: Select all
// pathLocal must be relative to the installed Models folder
public bool Load(string pathLocal)
{
string modelsFolder = RegistryDg.GetInstallationPath() + "Models\\";
string pathFull = Path.Combine(modelsFolder, pathLocal);
return m_iModel.Load(pathFull);
}