Cancel
Showing results for 
Search instead for 
Did you mean: 

Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Experimenter
Experimenter

Hey Guys,

 

does anyvone know if it is possible to have a look at the code of the method AddStringParameter of the NXOpen library?

 

I'd like to add some parameters of the Type Char to a Tag Form in NX12, but in the Dropdown-Menu there is no Type Char to select. So i hope i can have a look at the code of the method AddStringParameter to analyse this method and then write my own method which is able to add Char parameters.

5 REPLIES 5

Re: Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

could you provide a bit more context?

e.g.: What programming Language are you using?

To what Object does your method belong? (e.g.: AAA.AddStringParameter() ?)

 

if you are working with VB .NET you could convert a char to string before calling your method:

dim myChar as Char = 'A'
dim myString as String = CStr(myChar)

...AddStringParameter(myString,.......)

 

regards,

MGeyer

Re: Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Experimenter
Experimenter

I am using C# .NET.

 

The method is a member of NXOpen.Mechatronics.ParameterStockBuilder:

https://docs.plm.automation.siemens.com/data_services/resources/nx/12/nx_api/custom/en_US/nxopen_net...

Re: Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

okay, that claryfies it a bit Smiley Wink

 

so in C# you can do the following:

char ch = 'A';
string myString = ch.ToString();

afterwards you could try the following:

...ParameterStockBuilder.AddStringParameter("myParameterName", myString, ...........);

This should add a Parameter of type "String".

As far as I know, the NX/Simcenter GUI has no Parameter-type of "Char", so you could use this single-letter String if it fits your needs.

 

regards,

MGeyer

Re: Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Experimenter
Experimenter

I dont think that works for me.

 

When its finished, my programm should read the Data from a Data Block (contains only data of the Type char) that was exported from Tia Portal and transfer the Data to a Tag Table in NX. In the end the Tag Table should have the exact same size as the Data Block and i dont think this will be possible if i use only single-letter strings, will it?

Re: Source Code of AddStringParameter(string name, string value, bool predefined, bool readOnly)

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

maybe to understand it further:

How does the incoming data-format look like?
(e.g.: comma-separated csv ? or something else?)

 

And what shall be the end Result in NX?

(I think I don't quite understand, what you mean with "Tag Table"..(?))

Which specific functionality in NX are you trying to automate?

 

regards,

MGeyer