TypeScript Definitions for Forge Viewer missing getFragmentProxy - autodesk-forge

I'm using typescript definitions for Forge in link below:
https://forge.autodesk.com/blog/typescript-definitions-forge-viewer-and-nodejs-client-sdk-now-available
When I try to transform the model following this article:
https://forge.autodesk.com/blog/know-how-complex-component-transformations-viewer-part-1-basics, I realize viewerimpl is missing method getFragmentProxy.
How can I fix this?

Thank you for letting us know. This issue is caused by the missing type definition for the Viewer3DImpl#getFragmentProxy in the community contributed TypeScript definition file for the Forge Viewer (i.e. #types/forge-viewer) under DefinitelyTyped repository, so the TypeScript type checker/complier cannot find the type definition. The method is still there in the Forge Viewer JavaScript libs. To fix it, here are some suggestions for you:
Create an PR for adding the missing type definition of the Viewer3DImpl#getFragmentProxy on DefinitelyTyped repository yourself
Create a dummy .d.ts file to add the missing type definition somewhere in your code project. Please refer here for How-To (Link1 & Link2)
Wait for updates on #types/forge-viewer from us (Not recommended, it might take some time for one line code update)

Related

Forge-Viewer is missing iPart Factory Members and colors are wrong

Please be patient, I'm new to Forge, C-language, and web-apps, so I'm going to misuse terms and nomenclature like crazy. I'm working on converting a configurator from Configurator 360 to Forge. I created the original Inventor Assembly and iLogic and we farmed out the Forge side of the project. We use our ERP system to generate the engineering number we want from Forge. That number is passed to Forge through a URL and reversed engineered to select all the right options in Inventor. Then .step, .pdf, and .svf files are created with the viewer presenting the .svf and two buttons to download the .step or .pdf respectively. The .step and .pdf look just like they used to from C360 but my viewable is just wrong.
capture from Forge-viewer wrong capture from Inventor-step right
The color of the object should be black and it's white and all parts that are created using iFactories are missing. I don't know if this is two separate issues or caused by the way we are zipping the files for conversion.
I know I haven't given much to go on as to code that could be wrong because I'm not really sure where to start. I do see this in the Immediate Window
Loading model: dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cHJpbmNlX291dHB1dF9idWNrZXRfMTVlNDY2ZDYyNDU5NGQ3YmIyMjg0OWM3MDMxODgzOTAxL1BDNDAyMDAyMEEwMC0yOTBYVFhMLAAAAA
Exception thrown: 'Microsoft.JSInterop.JSException' in System.Private.CoreLib.dll
And then it throws that same exception 9 more times... that appears to be one less time then the number of parts that are missing from the viewer.
Any help is much appreciated even if it's just asking questions that might point me in the right direction.
Edit 1:
Found a new error that might help. It shows up if I refresh the browser.
ERROR: Cannot read properties of undefined (reading 'getRoot')
TypeError: Cannot read properties of undefined (reading 'getRoot')
at Object.loadDocumentNode (https://localhost:44365/_content/ForgeFunctions/forgeViewerJsInterop.js:168:40)
at https://localhost:44365/_framework/blazor.server.js:1:70369
at new Promise (<anonymous>)
at e.beginInvokeJSFromDotNet (https://localhost:44365/_framework/blazor.server.js:1:70335)
at https://localhost:44365/_framework/blazor.server.js:1:26442
at Array.forEach (<anonymous>)
at e.invokeClientMethod (https://localhost:44365/_framework/blazor.server.js:1:26412)
at e.processIncomingData (https://localhost:44365/_framework/blazor.server.js:1:24223)
at e.connection.onreceive (https://localhost:44365/_framework/blazor.server.js:1:17308)
at WebSocket.i.onmessage (https://localhost:44365/_framework/blazor.server.js:1:46784)
Edit 2:
I noticed when all the files were being copied to make the zip to create the svf, that a subdirectory was created for the iPart Members (named after the iFactory.) I use a flat zip file (all files in one big folder) so I tried creating a zip with a file structure to match our Vault structure. I then got errors that parts couldn't be found. Lots of other things were tried and then I found this blog post. I used the first option to add the "/p" in my Activity Command Line and set "autodesk.inventor.interop -> Embed Interop Types = false". My iFactory Members are now in the viewable!
Anyone have ideas on what's wrong with the colors? I believe "black" is the only color that is wrong. I do think it's a modified appearance from the appearance library but again the .step file looks good (aka is the color I set) so what in the viewer controls colors?
Edit 3:
So... I fixed the colors... I opened the file in Inventor. Opened the Appearance Browser and Unchecked "Self Illumination" for the "Black" color. Saved, Tested, Worked. Went back in turned "Self Illumination" back on, Saved, Tested, Still Works! So didn't really change anything just changed it and changed back and boom.

Is there an example of how to do a XAdES-BES enveloped signature with the XAdES4j library?

I'm trying to use the XAdES4j library to sign xml with an enveloped signature. From everything I've read it looks like it is possible to do exactly what I'd like to do, but I've not been able to find a simple example to help me to understand the workflow better. The library is found here:
https://github.com/luisgoncalves/xades4j
It includes a wiki, but the wiki does not give a clear example. It refers you to the unit tests in the code. However, in the code for the unit tests, there are numerous methods that do not exist in the main code stream. I'm looking for a simple example for a XAdES-BES enveloping signature to be added to xml given these variables:
The path to my xml file: /path/to/xml/myXmlFile.xml
The root element in my xml file: invoice
The path to my cert: /path/to/cert/myCert.p12
Password to my cert: "myPassword"
Can anybody help me out with a clear example?
Thanks so much in advance :)
Here's a full example provided by another user within an issue in GitHub. It illustrates both XAdES-BES and XAdES-T.
On the project's wiki you have detail instructions on which classes need to be used and pointers to more detailed information.
Regarding the unit tests, there are some common/helper methods on the base classes that can be useful in other scenarios, namely on SignatureServicesTestBase and SignerTestBase
Hope this helps.

Class file editor : Source not found error for ILock, ClassPathSuite classes

I am getting Class file editor : Source not found error for the classes in junit / hazelcast packages. Previously i got this error for all built in java classes. But after adding the Source zip file, i am able to see String.class and all. What i need to do for these classes. Please find the screenshot
Thanks in Advance!
Interestingly enough, your question contains all the concepts you need to know in order to answer it.
In order for your IDE to show you source code for any library you are using, the corresponding library needs to come with source code attached to it.
In other words: you managed to point your IDE to the ZIP file containing the source code for your JRE/JDK - thus your IDE knows what to show you when want to open up String.class
Now it seems that you are using other libraries as well. Maybe maybe, other libraries, have other, different source code ZIP files?!
Long story short: you need to add "source code" ZIPs for each and any additional library you are using and that you want to "peek into".
Within eclipse, you achieve that for example as described in that SO q/a. Side note: that is also something to keep in mind: you should do prior research before coming up with "new" questions. Especially when you are a beginner, you can be very sure that "your" question was asked here before.

Getting an error when attempting to acces a storyboard resource from code

A developer on my team did some refactoring of a control we're using in WinPhone 8 that represents a card that can be flipped.
We've created two animations using the storyboard named FrontToBackFlip and BackToFrontFlip, with declarations like: <Storyboard x:Name="FrontToBackFlip">
When a Tap is received we call
this.FrontToBackFlip.Begin()
or
this.BackToFrontFlip.Begin()
The refactoring the code worked before, but now we are getting the following error:
'Views.CardCarousel.IssuerCardControl' does not contain a definition for 'FrontToBackFlip' and no extension method 'FrontToBackFlip' accepting a first argument of type 'Views.CardCarousel.IssuerCardControl' could be found (are you missing a using directive or an assembly reference?)
Note that intellisense can find and complete the references to the Storyboards, so the namespaces and type names seem to be correct in both the XAML and code-behind. It's just that the compiler can't resolve these.
Any suggestions for tracking this down?
We were able to fix the issue by simply adding a new user control to the project, copy and paste the code from the control that was not building.

Infragistics license exceptions when MSBuild-ing

When running the MSBuild scripts for a project, I'm getting the following errors:
Properties\licenses.licx(1): error LC0004: Exception occurred creating type 'Infragistics.Win.UltraWinEditors.UltraNumericEditor, Infragistics.Win.UltraWinEditors.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
Properties\licenses.licx(2): error LC0004: Exception occurred creating type 'Infragistics.Win.Misc.UltraGridBagLayoutManager, Infragistics.Win.Misc.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
Properties\licenses.licx(3): error LC0004: Exception occurred creating type 'Infragistics.Win.UltraWinEditors.UltraCheckEditor, Infragistics.Win.UltraWinEditors.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
It appears that there's a problem with my machine's Infragistics license.
I have valid license files in my solution, so what's causing this issue?
There is a much easier solution: Set the build action on your license.licx to None.
From a user comment in Infragistics forum archive
install as the Sysadmin for "All Users" and then the
user will develop and compile their app.
Here is a workaround but unfortunately, this does not explain the root cause.
Here is a blog post from Infragistics to deal with automated builds but I don't think it is your case. And a further reference to that same post adding more info here.
I guess you had already looked at those links but they might be helpful to somebody else with a similar problem.
it's much easier just to only change the build compilation to any CPU and you're done!
it will run with no problem.
Make sure the license compiler (lc.exe) can find the location of your Infragistics assemblies. Also, if you've updated your components anytime recently make sure there aren't multiple copies with different version numbers lying around. Finally make sure that the version your are trying to use is the same version in the licenses.licx file.
An easy way to refresh the licenses.licx is it open the form designer, add an Infragistics component and remove it.
If for some reason the licenses.licx file doesn't refresh you can try removing the offending entries first then refresh it.