- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I would like to ask if someone could help me with this strange behavior: I'm using the comand "Parameter("","")" to get a parameter from another file, but the strange is that when I run the code in a desktop machine it works perfectly but when run in a laptop it return an error...
The code that is generating problem is:
MATERIAL_CONE = Parameter(arquivo, "CONE_DIMENSAO")
I should access the "arquivo" file and get the "CONE_DIMENSAO" parameter...
The error is this one:
the full code is:
Dim oAsmDoc As PartDocument oAsmDoc =ThisDoc.Document Dim oDoc As Document Dim oRefFile As FileDescriptor oDoc = oAsmDoc.ReferencedDocuments(1) arquivo = oDoc.DisplayName MATERIAL_CONE = Parameter(arquivo, "CONE_DIMENSAO") iProperties.Value("Custom", "CUSTOM_DIMENSAO") = MATERIAL_CONE
The same files are in a folder both in the laptop and in the desktop.
The comand "arquivo = oDoc.DisplayName" is working on the laptop, I have checked with a "messagebox.show" and returns the correct name.
Is there differnce to use this function on a laptop machine?
Thank you in advance,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI!
First...
Check if both inventors are in the same update version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @CCarreiras ,
Yes, they are on the same update version.
I have ran the code in two different laptops and both didn't work. I have ran the code in 4 desktops and all of them works.
Really strange...
Thank you in advance,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found here the issue:
The command :
arquivo = oDoc.DisplayName
Is afected with the windows configuration to show or not the extension.
I have changed the code to:
arquivo = System.IO.Path.GetFileName(oDoc.FullDocumentName)
and it works now!