Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic - export dxf from idw

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Ray_P
2671 Views, 8 Replies

ilogic - export dxf from idw

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?

8 REPLIES 8
Message 2 of 9
MjDeck
in reply to: Ray_P

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"

Mike Deck
Software Developer
Autodesk, Inc.

Message 3 of 9
Ray_P
in reply to: Ray_P

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.

Message 4 of 9
MjDeck
in reply to: Ray_P

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?

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 9
Ray_P
in reply to: MjDeck

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.

Message 6 of 9
MjDeck
in reply to: Ray_P

  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.


Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 9
Ray_P
in reply to: MjDeck

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

Message 8 of 9
MjDeck
in reply to: Ray_P

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

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 9 of 9
Ray_P
in reply to: Ray_P

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report