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: 

How to find extension of Inventor file.

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
283 Views, 5 Replies

How to find extension of Inventor file.

When I try to find the extension of the file that I'm working on, I have to
turn off "hide filetypename for known filetype". That means that myh program
only works on pc with shown filetype (extension), and not others. Is there a
way to find fileextension, that's not depending of setting "Hide filtypename
for known filetype".?

Her is my program, working fine with showing filetype name.....

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument

Dim file_type1 As String
file_type1 = Right(invDoc.DisplayName, 3)

Select Case file_type1

Case "ipt"
' MsgBox "det er en ipt fil"
' do somthing

Case "iam"
'MsgBox "det er en iam fil"
' do something else

Case "idw"
MsgBox "det er en idw fil"

Case "ipn"
' MsgBox "det er en ipn fil"
' do really something else.
End Select


best regards Henrik
5 REPLIES 5
Message 2 of 6
Josh_Petitt
in reply to: Anonymous

instead of using the DisplayName, you can use the FullFileName
Message 3 of 6
Anonymous
in reply to: Anonymous

Hi Josh.

Thanks that's just what I was looking for.

best regards.

Henrik
skrev i en meddelelse news:5766688@discussion.autodesk.com...
instead of using the DisplayName, you can use the FullFileName
Message 4 of 6
Anonymous
in reply to: Anonymous

use this simple code to figure out what type of document

Select Case ThisApplication.ActiveDocumentType
Case kDrawingDocumentObject
Debug.Print ".idw type"
'do something
Case kAssemblyDocumentObject
Debug.Print ".iam type"
'do something
Case kPartDocumentObject
Debug.Print ".ipt type"
'do something
Case Else
Debug.Print "ipn type"
'do something
End Select

--
www.CVAengineering.com

IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"Henrik" wrote in message
news:5766487@discussion.autodesk.com...
When I try to find the extension of the file that I'm working on, I have to
turn off "hide filetypename for known filetype". That means that myh program
only works on pc with shown filetype (extension), and not others. Is there a
way to find fileextension, that's not depending of setting "Hide filtypename
for known filetype".?

Her is my program, working fine with showing filetype name.....

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument

Dim file_type1 As String
file_type1 = Right(invDoc.DisplayName, 3)

Select Case file_type1

Case "ipt"
' MsgBox "det er en ipt fil"
' do somthing

Case "iam"
'MsgBox "det er en iam fil"
' do something else

Case "idw"
MsgBox "det er en idw fil"

Case "ipn"
' MsgBox "det er en ipn fil"
' do really something else.
End Select


best regards Henrik
Message 5 of 6
Anonymous
in reply to: Anonymous

Oop.,. use
case kPresentationDocumentObject for case else
since there are more than 4 cases.
CVA

--
www.CVAengineering.com

IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"CVAengineering" wrote in message
news:5769471@discussion.autodesk.com...
use this simple code to figure out what type of document

Select Case ThisApplication.ActiveDocumentType
Case kDrawingDocumentObject
Debug.Print ".idw type"
'do something
Case kAssemblyDocumentObject
Debug.Print ".iam type"
'do something
Case kPartDocumentObject
Debug.Print ".ipt type"
'do something
Case Else
Debug.Print "ipn type"
'do something
End Select

--
www.CVAengineering.com

IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"Henrik" wrote in message
news:5766487@discussion.autodesk.com...
When I try to find the extension of the file that I'm working on, I have to
turn off "hide filetypename for known filetype". That means that myh program
only works on pc with shown filetype (extension), and not others. Is there a
way to find fileextension, that's not depending of setting "Hide filtypename
for known filetype".?

Her is my program, working fine with showing filetype name.....

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument

Dim file_type1 As String
file_type1 = Right(invDoc.DisplayName, 3)

Select Case file_type1

Case "ipt"
' MsgBox "det er en ipt fil"
' do somthing

Case "iam"
'MsgBox "det er en iam fil"
' do something else

Case "idw"
MsgBox "det er en idw fil"

Case "ipn"
' MsgBox "det er en ipn fil"
' do really something else.
End Select


best regards Henrik
Message 6 of 6
Anonymous
in reply to: Anonymous

Thanks, just what I was looking for.

Henrik

"CVAengineering" skrev i en meddelelse
news:5769507@discussion.autodesk.com...
Oop.,. use
case kPresentationDocumentObject for case else
since there are more than 4 cases.
CVA

--
www.CVAengineering.com

IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"CVAengineering" wrote in message
news:5769471@discussion.autodesk.com...
use this simple code to figure out what type of document

Select Case ThisApplication.ActiveDocumentType
Case kDrawingDocumentObject
Debug.Print ".idw type"
'do something
Case kAssemblyDocumentObject
Debug.Print ".iam type"
'do something
Case kPartDocumentObject
Debug.Print ".ipt type"
'do something
Case Else
Debug.Print "ipn type"
'do something
End Select

--
www.CVAengineering.com

IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"Henrik" wrote in message
news:5766487@discussion.autodesk.com...
When I try to find the extension of the file that I'm working on, I have to
turn off "hide filetypename for known filetype". That means that myh program
only works on pc with shown filetype (extension), and not others. Is there a
way to find fileextension, that's not depending of setting "Hide filtypename
for known filetype".?

Her is my program, working fine with showing filetype name.....

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument

Dim file_type1 As String
file_type1 = Right(invDoc.DisplayName, 3)

Select Case file_type1

Case "ipt"
' MsgBox "det er en ipt fil"
' do somthing

Case "iam"
'MsgBox "det er en iam fil"
' do something else

Case "idw"
MsgBox "det er en idw fil"

Case "ipn"
' MsgBox "det er en ipn fil"
' do really something else.
End Select


best regards Henrik

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

Post to forums  

Autodesk Design & Make Report