XbimWindowsUI icon indicating copy to clipboard operation
XbimWindowsUI copied to clipboard

the model is not displayed on the client after deployment

Open RolandoTonin opened this issue 3 years ago • 2 comments

I inserted the XbimWindowsUI WPF viewer in NET 4.8 into my corporate desktop WPF application. If I start the application from Visual Studio 2022 or from the same workstation where Visual Stuido is installed, I can load and view the model. If, on the other hand, I deploy in the LAN for internal company use through the Publish function of Visual Studio on the clients the model is loaded, I see the tree structure of the entities, I see the grid but the model is not displayed in the graphic viewer and I do not receive errors . The same thing happens if I install the WPF App on the same workstation where Visual Studio is installed. I looked in the "Application Files" sub folder where I made the publish but it seems that the Xbim dlls are all there. What could I have forgotten?

RolandoTonin avatar Jul 20 '22 08:07 RolandoTonin

Probably the geometry dlls; try opening an xbim file instead, to test this.

On Wed, Jul 20, 2022, 09:04 RolandoTonin @.***> wrote:

I inserted the XbimWindowsUI WPF viewer in NET 4.8 into my corporate desktop WPF application. If I start the application from Visual Studio 2022 or from the same workstation where Visual Stuido is installed, I can load and view the model. If, on the other hand, I deploy in the LAN for internal company use through the Publish function of Visual Studio on the clients the model is loaded, I see the tree structure of the entities, I see the grid but the model is not displayed in the graphic viewer and I do not receive errors . The same thing happens if I install the WPF App on the same workstation where Visual Studio is installed. I looked in the "Application Files" sub folder where I made the publish but it seems that the Xbim dlls are all there. What could I have forgotten?

— Reply to this email directly, view it on GitHub https://github.com/xBimTeam/XbimWindowsUI/issues/187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJY7MOR4DWX3GL67J7DLUTVU6XJHANCNFSM54CURSAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

CBenghi avatar Jul 20 '22 08:07 CBenghi

I'd guess you need to install the VC runtime on the clients

See https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

andyward avatar Sep 30 '22 12:09 andyward

Hy Claudio, is it possible to change predefinedtype of a buildingelementprocy?

My below code not working:

using (var txn = model.BeginTransaction(element.GlobalId.ToString()))
{
    if (!string.IsNullOrEmpty(itm.AssignedPropertyName))
        element.Name = itm.AssignedPropertyName;
    if (!string.IsNullOrEmpty(itm.AssignedObjectTypeName))
    {
        element.PredefinedType = IfcBuildingElementProxyTypeEnum.NOTDEFINED;
        element.ObjectType = itm.AssignedObjectTypeName;
        element.Tag = itm.AssignedTagName;
    }
    txn.Commit();
}

Where elment is IIfcBuildingElementProxy.

Thanks a lot Rolando

RolandoTonin avatar Nov 28 '23 16:11 RolandoTonin

Rolando, this would be better off in a separate issue in xbim Essentials if you still have queries.

The code looks fine. Technically it should be

element.PredefinedType = IfcBuildingElementProxyTypeEnum.USERDEFINED; // rather than NOTDEFINED

Not quite sure what the exact problem is? How is it not working? You're not actually saving the model back to a file so it's possible you just need to save it back to IFC. e.g. model.SaveAs("file.ifc") (if using IfcStore)

andyward avatar Nov 28 '23 17:11 andyward

I also encountered this problem. I share the program folder with the network, and if the client runs the program directly, it will inevitably not be able to display graphics. If the client copies the program folder locally and then runs the program, the program can display graphics normally. I migrated the program from 4.8 to 6.0, but the problem still exists.

WZFWork avatar Dec 01 '23 00:12 WZFWork

So running the application from a network share fails? But works if they copy the files locally? We should log that in https://github.com/xBimTeam/XbimGeometry if that's the case.

My guess is it relates to how we probe for the native geometry assemblies in https://github.com/xBimTeam/XbimGeometry/blob/c1c22812601d0bd506c5f9230b731d0ab0c6e08a/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs#L42C37-L42C37

andyward avatar Dec 01 '23 12:12 andyward

Sorry, I need to correct it. I migrated the program from 4.8 to 6.0. Xbim.Common 5.1.435 Xbim.Essentials 5.1.435 Xbim.Geometry 5.1.541 Xbim.WindowsUI 5.1.234 When using the above version components, the client directly runs the program and can display graphics normally.

WZFWork avatar Dec 04 '23 01:12 WZFWork

So problem solved? I suspect it'll be because we using Assembly.Codebase rather than Assembly.Location to locate the executing folder. The former accounts for Shadow-copying (e.g. in legacyASP.NET apps)., but has been deprecated in Net Core (and I my guess is Codebase is forwarding to Location on NET Core, which perhaps supports UNC paths differently)

This whole area has changed in v6 geometry so no plans to address this, unless someone want to supply a PR.

Have logged an issue in Geometry to track

andyward avatar Dec 04 '23 10:12 andyward