Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
rafael.morenoP66TL
290 Views, 3 Replies

Parameter Error on laptop

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:

 

rafaelmorenoP66TL_0-1659106854900.png

 

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,

 

 

 

 

Labels (1)

HI!

First...

Check if both inventors are in the same update version.

CCarreiras

EESignature

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,

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!