I am trying to use ILOGIC - to export dxf from idw
I get the rule to run everything is ok - Now how do I change the location where dxf is saved?
I have tried other snippets from "document" with no success.
I do not want the dxf saved this.doc.pathandfilename
'Set the destination file name
oDataMedium.FileName = ThisDoc.PathAndFileName(False) & ".dxf"
any help would be greatly apreciated?
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
Solved by MjDeck. Go to Solution.
Do you want to save it with the same name as the drawing, but in another directory? Something like this would work:
oDataMedium.FileName = "C:\InventorDxf\" + ThisDoc.FileName() + ".dxf"
Thank you that worked perfectly. I think I have a bug though.
I also used a snippet to hide the bend extents layer before exporting the dxf. I tried running the ilogic code by itself firts to test. & It does hide the layer but when I manually select the the layer control (GUI) to turn the bend extents back on the light bulb was still glowing. Put simply the Ilogic code does what it says but the gui is reversed. Turing the light bulb off turns on the layer and vise versa. Has this been reported? or is this the learning part of programming with Ilogic? I have fixed it by copying the code at the end and setting the layer state back to true.
I don't see that happening in my test. You're using Inventor 2011, right? Can you post a part and drawing that shows this problem?
yes IV 2011. XP
After running the code twice check layer control. I saved the sample file with the layer control in reverse. Bend Extent will be off and light bulb on. I know its really dumb to run the code twice but it did reverse.
The test.idw drawing was empty, so I added a flat pattern view of the part. Note that you have to turn on the Bend Extents option of the view (on the Display Options tab) to show the bend extent lines.
I still don't see the problem you describe. One thing: after setting a layer on or off in the Edit Layers dialog, you have to refresh the drawing (hit F5 or Home for example). Maybe Autodesk should change this behavior.
Similarly in an iLogic rule after setting a layer Visible or invisible, you can use the statement
ThisApplication.ActiveView.Update()
To update the dsplay.
If you still see the problem, please post the drawing with a view.
I am sorry I must have deleted it by mistake before I saved it. I will try one more time. The rule or code I am using is straight from Ilogic. I will try it on a coworkers pc to see if I get the same results. I will also try the snippet you posted. Should I add the code on the end after my dxf is exported?
The layer state will reverse if you run the rule 2 or three times. Then check layer controll. Sorry for the confusion.
And turnning on the Bend Extents by default when placing a flat pattern - (option of the view (on the Display Options tab) to show the bend extent lines) will be my next Ilogic endeaver (if you want to include the code feel free). I am real new to Ilogic. The option to show or not show bend extents by default should have been included in aplication options long ago. (user since R4)
Thank you in advance
I tried your new drawing and I still don't see the layer light bulb going on when it should be off. I ran the rule two or three times.
You should put the line
ThisApplication.ActiveView.Update()
anywhere after the line
ThisDrawing.Document.StylesManager.Layers("Bend Extent (ANSI)").Visible = False
Ok it must be my computer. Thanks for you time
BTW - Do you have I logic code to turn on the bend extents - when placing a flat pattern? Other than selecting display options & putting a check mark in the show bend extents box manually. We have tried saving the template with the checked box.
My pain everytime I create a drawing. = "Note that you have to turn on the Bend Extents option of the view (on the Display Options tab) to show the bend extent lines."
Thanks again