RUN iLogic rule on drawing (old C360_OnPublish) - autodesk-forge

when we used configurator 360 we could start a rule on the Inventor Drawing (idw) simply by calling it "C360_OnPublish".
Now with Forge it doesn't work anymore.
Run Rule is essential to be able to do a quick scaling of the view after a configuration update the drawing, and before the PDF is published.
Is there a quick method that allows you to do the same thing?
we also tried to insert the rule in the Inventor EventTriggers ('Before save document' or 'Drawing view change') but without success.
thank you

Configurator 360 is available in Design Automation. You would need to trigger the rule yourself using Inventor API, depending on your code logic.

You can run directly iLogic macro from your FDA AppBundle. You need to obtain the iLogic Addin first and then start a method from this Addin.
ApplicationAddIn iLogicAddIn = inventorApplication.ApplicationAddIns.ItemById["{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"];
dynamic iLogicAutomation = iLogicAddIn.Automation;
iLogicAutomation.RunRule(doc, "Your_iLogic_script");
Another option is to run the iLogic script directly from your activity without the AppBundle, but there are some caveats related to that, mainly long operations without any output and with missing heart beating can cause the processing timeouts. This video demonstrates how to do that:
https://youtu.be/kA82e_XcMrY?t=100

Related

Is it possible to use ThisApplication.CommandManager in Inventor Design Automation?

I have an iLogic rule tied to an Event Trigger in an Inventor drawing. The rule contains the following line of code;
Call ThisApplication.CommandManager.ControlDefinitions.Item("DrawingArrangeDimensionsCmd").Execute()
While the above line works fine in Inventor Desktop, it is causing a failure in Inventor Design Automation. I have isolated the issue to this line because if this line is commented out, the rule runs fine in IDA.
The purpose of the above line of code is to call the "Arrange Dimensions" command. I suspect perhaps that calling commands is not allowed in IDA, but need to confirm.
Avoid to use direct command execution on DA. Use appropriate method from API instead.
In this case it is a method DrawingDimensions.Arrange Method

PlotlyJS.jl "savehtml" not defined

I need to share an interactive plot made using the PlotlyJS package in Julia. According to the documentation of the package PlotlyJS.jl, I need to use the "savehtml" function and set "js" argument to ":embed" in order to view it offline (screenshot attached). However, I got an error "UndefVarError: savehtml not defined". Can anyone tell me what may cause this problem?
FYI, the "savefig" function can save the plot into an HTML but the HTML cannot be viewed on other machines.
It is also acceptable if there is another way to save an HTML plot that can be assessed from other machines. The interactive plot is generated by PlotlyJS.jl.
Thanks very much in advance.
This creates a standalone file that can be used on other machines.
However, those other machines need to have access to the internet:
p = PlotlyJS.Plot(sin.(1:0.1:10))
open("f.html","w") do f
PlotlyJS.PlotlyBase.to_html(f, p; include_plotlyjs="cdn", full_html=true)
end
I just checked that this is as far as you can do as of today (version v0.8.18) as there is a bug in the source code of PlotlyBase.

How load custom .net dll with accoreconsole.exe in Design Automation with all AutoCAD DLL's

I have created a AutoCAD custom .net dll for the desktop version which had some operation.
Adding multiple empty drawing documents.
Opening the existing drawing document and copying the required blocks in the newly created drawing document.
Performing some operation on them, discarding all the unnecessary drawing documents and saving one of them as an output drawing document.
I had a query regarding opening the existing document and adding the empty document using Design Automation API but I couldn't achieve it with Design Automation.
As I explored I found that only AcCoreMgd.dll and AcDbMgd.dl are allowed with accoreconsole.exe.
Load custom .net dll inside accoreconsole.exe
DLL's used by AutoCAD custom .net project for desktop version are (AcCoreMgd.dll,AcCui.dll,AcDbMgd.dll,AcMgd.dll,AcTcMgd.dll,AdUIMgd.dll)
I wanted to use all the above DLL's with Design Automation for AutoCAD.
Will you please let us know how we can use desktop versions like support in Design Automation for AutoCAD?
It is not possible to add other modules when working with Design Automation or AccCoreConsole. Please note AcCoreConsole is a Headless part of AutoCAD in other words no UI libraries are permitted. Following are the libaries that a crx app should bind.
Where XX - module version of AutoCAD release for more details
If you are developing a .NET module, you need to use following Nuget
ac1stXX.lib
acdbXX.lib
acdbmgd.lib
AcDbPointCloudObj.lib
acgeXX.lib
acgiapi.lib
acismobjXX.lib
AcMPolygonObjXX.lib
AcSceneOE.lib
axdb.lib
rxapi.lib
acbrXX.lib
acgexXX.lib
AdImaging.lib
AdIntImgServices.lib
AecModeler.lib
AsdkHlrApiXX.lib
acapp_crx.lib
AcCamera.lib
accore.lib
AcFdEval.lib
AcPublish_crx.lib
Why do you need to open mutilple documents ?, you can insert multiple blocks from different drawings in to Host drawing. Make modifications, save and send to your Server.

Autodesk-Forge configurator live sample with geometry change

I want to build enterprise solution for configurator base on Autodesk Inventor models and drawings. I want to have ability to change dimension of assembly (witdh, depth, length and another). I want to see changes on model in real time (something like here but with changes dimensions in custom values: https://tylko.com/shelf/bookcases/1429438/?cv=0&board=cat_all__type_all__id_4267)
As a result I want to have fully documented model with drawings.
Can Forge do that? Is there any demo?
Yes, here's a sample application that does something similar.
https://forge-rimconfigurator-inventor.herokuapp.com/
You can find the source code of the above application here:
https://github.com/sajith-subramanian/forge-rimconfigurator-inventor
There also is another intricate sample available. You can find it here:
http://inventor-config-demo.autodesk.io/
The source code of the above sample is available here:
https://github.com/Autodesk-Forge/forge-configurator-inventor
Thank you for response. Provided samples are different than:
https://tylko.com/shelf/bookcases/1429438/?cv=0&board=cat_all__type_all__id_4267
My sample is dynamic. Is there a possibility to not wait for change update. Same as you can see change directly in Inventor.

How do I disable code generation in my test plugin?

I have a couple of test files written in my DSL in my tests plugin/project. Most of the tests use inline multi-line strings and Xtend but in four cases, I need to test code which does some magic with URLs and the classpath, so I really need resources in the classpath for that.
Since loading the resources only works when the extension is correct, I can't give the files a fake extension.
Now my problem: My DSL also has a code generator. This means that eventually, I end up with a couple of generated files in places where I can't have them (they don't compile, for example, and one even contains an error to test error handling when information is split across several files).
I can't disable the Xtext nature because the tests project uses Xtend so for these files, I do need code generation.
Since the generator runs inside Eclipse (I have the DSL plugins installed for other projects), there is no way to override the code generator in Guice.
How can I disable the code generator in this case?
There is a simple way to achieve this:
Open the properties of your project
Expand the entry for your DSL
Select "Compiler"
Select "Enable project specific settings"
Disable/deselect "Compiler is activated" under "General"
If you don't have a properties entry for your DSL:
Add this fragment to your .mwe2 workflow file:
fragment = generator.GeneratorFragment {}
Regenerate your projects
Merge the new code from plugin.xml_gen into plugin.xml both in the base and the UI plugins.
The interesting parts are the two extension points org.eclipse.ui.preferencePages and org.eclipse.ui.propertyPages