AutoCAD Inventor :: Listening To Events - Python To Write DXF Files Out
Jun 21, 2012
I wrote a small script in python to write dxf files out. I want to add this to a button on the ribbon. I got that sorted out and can get my button to appear where I want it. I am having trouble calling the script from the button though.
The API tells me that the button has an OnExecute() event that I should listen for to call my script. I have been searching on how to do that from python but I haven't had any luck.
I need the image to ALWAYS be on the bottom, but as I draw things sometimes, for no rhyme or reason, it draws it underneath the image and i have to do draworder again to bring it to the front?
How to "grab" the print event (Ctrl-P, File Print or Print icon) from an add-in. I would like to force the user to add some information about the print in a dialog before printing a drawing.
I can't find any application or document events fired when printing like OnSaveDocument, OnQuit in the object browser.
I have obtained a very useful macro from another discussion thread, [URL]....... It automatically names the frame members inserted by Frame Generator. I have modified the macro for our internal naming conventions, but the basic functionality is the same. I would like it to load automatically whenever I am in Inventor and believe an Add-In is the way to go. I have followed Brian Ekins "Taking the Step from VBA to Inventor Add-Ins" paper, but I think I am missing huge chunks on how Add-ins handle events and have been unsuccessful in finding any help topics. How to handle events in an add-in.
how you put the rule in but is there a way to remove the rule. I put one in and I don't like how its acting and would like to remove the rule from the list but I see no way do do so...
After some fooling around with LR4, I went out and bought Martin Evenings PSLR4 'book', did some read and started looking for a photo to play with...
I discovered that all of the photos on my usb hard drive were either write protected or the image type was not supported-they're all .jpg. I had done some Copyright stuff on a few photos the day before...fooled around with import and export and some other exploring.
I have converted a large number of Canon and Nikon raw files to DNG using Adobe DNG Converter (version 8.2.0.94).
Using Lightroom 5.2 I wanted to change metadata in these master DNG files. I import the files into a catalog, select all, modify the metadata, then invoke the Metadata->Save Metadata to Files... For many (but not all) of the files I get the following message:
"Could not write metadata. Unknown file formats."
The DNG files reside on a Synology NAS server. If I copy them to a local disk I do not get the above error. But I would like to make metadata changes to the files on the NAS.
I do not have problems importing or viewing DNG files from the NAS. Why does LR 5 have problems writing DNG metadata to the NAS? How can I fix this?
we write metadata to jpegs and Raw files- saving to Raw database not as sidecar .xmp files. We are no longer able to save the metadata to Raw files. There is no error message, the data writes like normal and the user who writes the metadata can see it but when you open in another computer the metadata fields are empty, however the jpegs do have the new metadata. Was there a setting change at some point? This has been going on for a couple months and I cannot find an answer anywhere. Again, we batch write to RAW+Jpeg, the jpeg files save the metadata but the Raw files look like the data saved but is not visible on any computer other thant he one that added the new metadata. This is occurring on multiple computers, both Mac and PC.
I'm trying to write a program in C# to automate ballooning from a BOM.The routine must read the BOM and for every row it highlights in all the views the corresponding component.Then the user must be able to manually draw a balloon or balloons to the highlighted items.
When done the next row of the BOM is called, etc.I can choose to start with a BOM from our PDM system or the Inventor BOM, partlist or drawingBOM
I tried different ways but I get stuck on it.I even tried to select the nodes in the browser and called oNode.doselect, but then I can't get the proper type for the selected items to go further?
When I try to create a custom ribbon cable I get a message that reads:
"The cable and harness library is being edited by another user or is marked as read only. The Cable and Harness Library will be opened in read-only mode. No changes can be made to the cable and harness library, but wires and cables can still be inserted into the harness assembly."
In my project file I made "use style library" to = Read-Write
System Specs:
Windows 7 Pro Autodesk Product Design Suite Ultimate 2014 Autodesk Vault Basic 2014
I'd like to format the memory stick that Inventor was shipped on. (Don't need it anymore) But when I tried to format the stick I got a error "The disk is write protected". Is it not possible to format the disk? I rather reuse it than throw it in the thrash..
I am unable to write Tag data to NEF files with Elements 5.0 even though it says this is possible. I have just changed my laptop to a Windows 7 operating system. Will upgrading to 10
I have this little iLogic snippet that writes out the name and value of all parameters in active document.
doc = ThisDoc.Documentparams = doc.ComponentDefinition.Parametersnames = New List(Of String)values = New List(Of String)For Each param In paramsIf Len(param.Name)>4 Thennames.Add(param.Name)values.Add(param.Value.ToString)ElseEnd IfNextMultiValue.List("ParamsList") = namesMultiValue.List("ParamsValues") = valuesGoExcel.CellValues("COVER.DEFAULT.PARAMS.xlsx", "Sheet1", "A2", "A400") = MultiValue.List("ParamsList")GoExcel.CellValues("COVER.DEFAULT.PARAMS.xlsx", "Sheet1", "B2", "B400") = MultiValue.List("ParamsValues")GoExcel.SaveGoExcel.Close
The problem is it ignores the parameter's units and assumes cm for length and rad for angular. I need another nested IF - Then that says:
IF param.Values.'UnitType' is "in" THEN param.Value = param.Value/2.54 Else If param.Values.'UnitType' is "deg" THEN param.Value = param.Value*360/2/3.14159 End If
I am testing PSP X6 (I have all versions since V7) and now I get wrong files with the PNG Optimization. This functions used to write files with the extension png but now it writes png files with the extension pspimage. If you try to open such a file you will get error messages.
PSP seems to be back with version X6 with again destroyed old functions. It seems so as if will not buy the update this time. With each new version I get new bugs in old functions.
Is it possible to write multiple prompted entry fields down in a single pass? As it is now, you can see the taskbar reporting as it writes down each line.
Essentially i've got 6 different fields i'm trying to write down using code like shown below:
If oTB.GetResultText(oTitleBox1) <> Me.Title1.Value Then Call ThisApplication.ActiveDocument.ActiveSheet.TitleBlock.SetPromptResultText(oTitleBox1, Title1.Value)End IfIf oTB.GetResultText(oTitleBox2) <> Me.Title2.Value Then Call oTB.SetPromptResultText(oTitleBox2, Title2.Value)End If
Just wondering if there's a way it can be written down in a single pass to save time or if it's a limitation of prompted entry text.
I'm trying to create an iLogic rule that will print a text string to a cell or coloum of a parts list in inventor.
My code so far...
Sub Main() On Error Resume Next Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument [code]......
I want to print what is in the Message Box into a cell in the parts list, and i am stumped. The cell i am trying to print to is a user property in the Parts List.
I'm trying to create an iLogic rule that will print a text string to a cell or column of a parts list in inventor.My code so far...
Sub Main() On Error Resume Next Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument [code]...
I want to print what is in the MessageBox into a cell in the parts list, and i am stumped.The cell i am trying to print to is a custom property in the Parts List.
I'm having some problems with a python command. I'm working on an image that is 640x640. I'm trying to do a horizontal flip of a layer with this command:
the flip succeeds, but it generates a distortion on the flipped layer. When I try to flip that layer through gimp's interface, it is smooth.
I understood that the input values for the flip function were the layer, x and y of one point of the axis from wich the image will be flipped, and x and y of the end point of that axis. Here is the failure in the flip that I mentioned: URL....
this shouldn't happen or the flip will be useless for what I am trying to do. (the eye with problems is the first one, from left to right).
I have created a basic add-on that shows a modal windows form. The only issue I am running into is that I am completely unable to capture any key events in the form. I just want to make the escape key close my form, but I'm having no luck. Here is my basic setup:
<CommandMethod("myCommand")> _Public Sub myCommand() Dim myForm As Form1 = New Form1Autodesk. AutoCAD. Application Services. Application.ShowModalDialog(myForm)End Sub
Then in the form code, I have this, for testing purposes:
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress MsgBox("keypress") End Sub
I've also tried KeyUp and KeyDown. Key presses are working inside the form (I can use the keyboard to select an item in a combobox, for example), but I never hit the event handlers.