Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic/VBA different Document Display.Name

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
1019 Views, 2 Replies

iLogic/VBA different Document Display.Name

 

Hello

 

I'm having trouble getting the display name from all the nodes in an assembly file. 

 

I'm using the following code to iterate through the contents of the documents collection in two different computers 

hoping that i get the same results. Instead of that, i'm getting a different outcome.

 

The problem is that, the COMPUTER A is returning the display name with an extension of the file (.ipt or .iam) and the COMPUTER B is returning

the name without extension (just what i need).

 

I know that i can check the display name and remove the extension with a few lines of code but i would like to know the reason of this

behavior.

 

The code is:

 

 

Sub test()
    ' Iterate through the contents of the Documents collection.
    Dim invDocument As Document
    For Each invDocument In ThisApplication.ActiveDocument.AllReferencedDocuments
            ' show display name
            MsgBox invDocument.DisplayName
    Next
End Sub

Capture2.PNGCapture4.PNG

 

Capture.PNGCapture3.PNG

 

Thank you in advance.

2 REPLIES 2
Message 2 of 3
Curtis_Waguespack
in reply to: Anonymous

Hi cvillar,

 

My guess is that one computer has the option to Hide Extensions for know file types enabled and the other does not.

 

You can check this using these steps (for Windows 7, it might vary a bit if you're using a different OS):

 

  1. Click the Start menu. ...
  2. Type "folder options" (without the quotes). ...
  3. A dialog box with the title "Folder Options" will appear. ...
  4. Click to uncheck the box for "Hide extensions for known file types".
  5. Click the "OK" button at the bottom of the dialog box.

Also just as a tip for the future, generally programming questions of this type are best placed on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 3 of 3
Anonymous
in reply to: Curtis_Waguespack

Thank you Curtis! This is just what I needed.

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

Post to forums  

Autodesk Design & Make Report