Here are the questions we got this week so far:
Q: Is there a method to get the sketch to model transform (like in Inventor)?
A: Yes, the Sketch object has a transform property that provides the transformation matrix for exactly that.
Q: xyConstructionPlane. Where does it belong on the chart?
A: The chart isn’t able to show every connection to every object. The xyConstructionPlane is a property supported by the Component object that returns a ConstructionPlane object.
Q: How do you create a collection in case I need a specific group of objects to use as input to another command? For example in the UI to create a split button in the navigation toolbar the second argument is a “Collection” of command definitions. It does not seem to accept [cmdDef1, cmdDef2, cmdDef3] as the argument. Do you have to explicitly create a “collection” of command definitions?
A: You can create a collection using adsk.core.ObjectCollection.create() function. Then you can add items to this collection using its add() method.
Q: How to activate intelli-sense / auto-complete in Spyder on Mac?
A: It should be working by default, but it seems there is an issue with this in case of the MAS (Mac App Store) version of Fusion. Web install version for both Windows and Mac seem to work fine. The issue is logged and will be investigated.
Q: Since ImageCommandInputs display PNG’s at their native size – what happens on a hiDPI screen? Is the image automatically doubled in size?
A: This works similar to how you provide the images for your buttons. High definition images should be named in a way that they end with “@2x”, e.g. MyImage@2x.png
If you pass in MyImage.png as the parameter for the addImageCommandInput() function on a high definition display (e.g. MacBook with Retina display) Fusion will look for a file name ending with “@2x” (i.e. MyImage@2x.png) and if it exists it will use that. If it does not, then the low quality image will be scaled up.
As an example, if I have these files in my resources folder:
… and I have this code
inputs.addImageCommandInput('imageInput', '', './resources/32x32.png')
… and I’m running Fusion on a computer with high definition display, then ‘./resources/32×32@2x.png‘ will be used:
If the high definition image cannot be found then the low quality image will be stretched to the same size:
Q: Can we use HTML styled text in message boxes?
A: No. Message boxes do not support HTML for the contents. For more advanced formatting you will need to use a command dialog where the TextBoxCommandInput does support basic HTML formatting. Look for the TextBoxCommandInput section in the help topic for commands
Q: Is there a way to retrieve the Fusion user’s email address registered with Autodesk?
A: Not programmatically. But if you published your app on the Autodesk App Store, and a user buys your app then you’ll get an email with the user’s email address in it. You can also access this information later on from the “Publisher Corner” where you can get the download records emailed to you.
Q: How to create a cone?
A: There is no primitive for cones inside Fusion. You can create cone geometry in multiple ways. One of which could be extruding a circle with a taper angle. No matter how the geometry got created, when investigating it using the BREP API you should find the same things if the created geometry is the same.
Q: How to create the plugging-holes-with-corks sample shown during the webcast?
A: I’m still working on this sample and will post the completed code when it’s finished.
Q: How to get the modified JavaScript code to run in Fusion after editing it in Brackets?
A: There is an issue on the Mac with the Apple web component we are using, because it caches the original JavaScript file and keeps using that instead of the modified version. Apple said they will work on fixing this issue.
Q: Does Fusion support compiled Python files (*.pyc)?
A: Yes, it does.
-Adam




Leave a Reply