iLogic to rename AutoCad Files after export

iLogic to rename AutoCad Files after export

Stansteel
Enthusiast Enthusiast
665 Views
7 Replies
Message 1 of 8

iLogic to rename AutoCad Files after export

Stansteel
Enthusiast
Enthusiast

Hello,

I have an iLogic rule written to export my Inventor drawings to AutoCad files.  When the autocad files are created, there's an underscore included in the name, which I know can't be changed.  However, can a code be written within the iLogic rule to simply search for and rename these files without the underscore?

0 Likes
666 Views
7 Replies
Replies (7)
Message 2 of 8

bradeneuropeArthur
Mentor
Mentor

what do you mean with search:

in Inventor?

in explorer?

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 8

Stansteel
Enthusiast
Enthusiast

By search I meant in explorer.   Once Inventor has exported said autocad files into a folder, it would then find these files and rename them.

0 Likes
Message 4 of 8

bradeneuropeArthur
Mentor
Mentor

use the fileinfo object for that and rename the file as needed

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 8

bradeneuropeArthur
Mentor
Mentor

like this:

 

Dim fio As  System.IO.FileInfo
Dim dio As New System.IO.DirectoryInfo("D:\Files\test folder")
For Each fio In dio.GetFiles
	MessageBox.Show(fio.Name)
	fio.MoveTo( "D:\Files\Inventor Projects\TestCC\New folder\piet.ipt")
	Next

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 8

Stansteel
Enthusiast
Enthusiast

Not quite there.  I don't want to have to manually rename each file.  Let me be more specific.

For example:

I create an Inventor drawing (1234-56-A1) and export to AutoCad.  The exported file format is (File Name_Sheet Name.dwg), therefore the file name would be 1234-56-A1_1234-56-A1.  I want to remove the file name and underscore.  So the new autocad name would match the original drawing name (1234-56-A1.dwg).

 

Nate

0 Likes
Message 7 of 8

bradeneuropeArthur
Mentor
Mentor

@Stansteel wrote:

Not quite there.  I don't want to have to manually rename each file.  Let me be more specific.

For example:

I create an Inventor drawing (1234-56-A1) and export to AutoCad.  The exported file format is (File Name_Sheet Name.dwg), therefore the file name would be 1234-56-A1_1234-56-A1.  I want to remove the file name and underscore.  So the new autocad name would match the original drawing name (1234-56-A1.dwg).

 

Nate


so in your example the inventor drawing is 1234-56-A1.dwg and the sheet name in this drawing is 1234-56-A1.

You export it to Autocad format with a rule and the Autocad drawing is called 1234-56-A1_1234-56-A1.dwg, correct?

 

Where is the eXport rule and how how is it coded?

Would it be easier to modify the code with the correct autocad drawing name 1234-56-A1.dwg????

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 8 of 8

Stansteel
Enthusiast
Enthusiast

Yes, that is correct.  Let me give a second example...

 

Let's say the Inventor drawing file name is (1234-56.idw), and it has three sheets (named 01, 02 & 03).  When exported, (3) Autocad files are created (1234-56_01.dwg, 1234-56_02.dwg & 1234-56_03.dwg).  This can be done using the standard "Save Copy As" command in Inventor.  I have an iLogic rule that simply triggers this process, along with a few other tasks.

 

I would like the iLogic rule to change the underscore to, say, a dash.  The new files would be (1234-56-01.dwg, 1234-56-02.dwg, 1234-56-03.dwg)

 

Nate

0 Likes