Inventor Customization

Inventor Customization

Reply
*Henrik
Message 1 of 6 (93 Views)

How to find extension of Inventor file.

93 Views, 5 Replies
11-01-2007 03:31 AM
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
Distinguished Contributor
Josh_Petitt
Posts: 5,400
Registered: ‎09-21-2004
Message 2 of 6 (93 Views)

Re: How to find extension of Inventor file.

11-01-2007 06:54 AM in reply to: *Henrik
instead of using the DisplayName, you can use the FullFileName
*Henrik
Message 3 of 6 (93 Views)

Re: How to find extension of Inventor file.

11-04-2007 01:37 PM in reply to: *Henrik
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
*CVAengineering
Message 4 of 6 (93 Views)

Re: How to find extension of Inventor file.

11-05-2007 10:02 AM in reply to: *Henrik
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
*CVAengineering
Message 5 of 6 (93 Views)

Re: How to find extension of Inventor file.

11-05-2007 10:14 AM in reply to: *Henrik
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
*Villars
Message 6 of 6 (93 Views)

Re: How to find extension of Inventor file.

11-07-2007 12:12 AM in reply to: *Henrik
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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.