Save as file name length

Save as file name length

andrewiv
Advisor Advisor
319 Views
2 Replies
Message 1 of 3

Save as file name length

andrewiv
Advisor
Advisor

I'm running into an issue when trying to do a save as using iLogic and I'm wondering if there is a limitation of the file name length when doing the save as.  The below code is a the section I'm having problems with.  When its doing the save as it always throws up an error, but if I changes the path from E:\Work\Engineering\Drawings\ to E:\Work\Engineering\Drawing\ it works fine.  Why would dropping the "s" make any difference?

 

'Dim oNewHoseAssy As AssemblyDocument
			
	oNewHoseAssy = ThisApplication.Documents.Add(kAssemblyDocumentObject,,False)
	
Dim oCompName As String Dim DwgFldr As String Dim HydFldr As String Dim FileName As String
oCompName = 504900.01 DwgFldr = Left(oCompName, 3) HydFldr = oCompName.Split(".")(0) FileName = "E:\Work\Engineering\Drawings\" & DwgFldr & "\" & HydFldr & "\" & oCompName & ".iam" oNewHoseAssy.SaveAs(FileName, False)

Andrew In’t Veld
Designer / CAD Administrator

0 Likes
320 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

When saving a file into a folder, the folder must exist before saving.

 

You can search stackoverflow or google to find out how to do this.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

andrewiv
Advisor
Advisor

All the folders do exist, And if I run it when the folders don't exist it does create them.

Andrew In’t Veld
Designer / CAD Administrator

0 Likes