How to Set Options in SolidEdge using C#

 

Hi,

 

1.  I am generating *.dxf file to the *.DFT , so i need to Set a option "All Sheets" instead of default option "Active Sheet Only" .  How can i do this from C# code

 

2. I am exporting *.ASM to *.STP , here i need to set an option call "ExportAP214" . How can i do this from C# code.

 

 

Any help in this regrad appreciated.

 

Thanks in advance

Venkata Ramesh V

 

Posted by: Venkata Ramesh Virodhula
Post date: 7/12/2011 4:11:01 AM

6 REPLIES

RE: How to Set Options in SolidEdge using C#

Hi Venkata,

 

unfortunately in most cases you can't specify any options via API. You have to manipulate the corresponding ini files prior to execute SaveAs.

Some ini files have to be modified at their original location in the Program folder of the Solid Edge installation and also must not be renamed, while DXF/DWG and IGES allow to use custom ini files saved at any location. The access to the ini files used for DXF/DWG and IGES happens via a pathname saved in the registry of the current user. By manipulating this pathname prior executing SaveAs you may use prepared ini files.

 

 

Posted by: Wolfgang Kunert
Post date: 7/12/2011 9:17:53 AM

RE: How to Set Options in SolidEdge using C#

Hi Wolfganf,

Thanks for the info. I found the required tags, so i implemented the SEACAD.INI file for exporting "ALL SHEETS TO ONE FILE" while exporting *.dft to *.dxf . but the problem is how to trigger this file without manaully changing the file location, how i change AutoCadConfiguration file location from default location to required location from C# code.

 

 

Thanks

Venkata Ramesh V

 

Posted by: Venkata Ramesh Virodhula
Post date: 7/13/2011 1:26:00 AM

RE: How to Set Options in SolidEdge using C#

 

Hi,

May be my question is not clear for you, so i am posting it again.

 

1. I am exporting *.dft file to *.dxf file, where in i need to change sheet options from "Active sheet only" to "All sheets" . Here i came to know that there is no API to handle this thing, so i wrote my configuration file but the problem is

I need to change the default CAD CONFIGURATION FILE (SEACAD.INI) location to point to my configuration file (which i wrote with required settings). How i can do this from C# coding.

 

2. While importing the *.IGS file, SolidEdge is not automatically recognising the actual file (i.e *.PAR or *.ASM) and so its asking me like open with which template. So i thought of using "OPENWITHTEMPLATE" but the problem is how can i find whether the given .IGS file is an *.ASM or *.PAR . (I opened the *.igs file in Text editor, i found that there are extensions like ".SLDPRT" or ".SLDASM" if that *.igs file is exported by SOLIDWORKS where as if that *.igs file is exported by SOLIDEDGE i didnt found any tags that can differentiate as PART OR ASSEMBLY File). So how i do this from C# coding. (or what are the tags that differentiate the IGS file as PART or ASSEMBLY).

NoteI tried opening this *.IGS File which is exported from SOLIDEDGE in SOLIDWORKS, it is not asking me for the template but is opening automatically with the required template, which means there should be some tags different in both PART and ASSEMBLY - *.IGS files. can you tell me that tags please. )

 

3. Finally Exporting files to *.STP file,where in i need to change the TRANSLATE OPTIONS to "EXPORTAP214". how to do this in C#.

 

 

Any help in this regard worth appreciated.

Thanks in advance

 

Venkata Ramesh V

 

 

Posted by: Venkata Ramesh Virodhula
Post date: 7/13/2011 9:27:41 PM

RE: How to Set Options in SolidEdge using C#

Hi,

 

I Found the Configuration file for STP Options. "STEP3D.ini" in program folder of SolidEdge. In that change "Export AP214 Format=off" to "Export AP214 Format=on". but the thing is i didnt find any browse option to set this file location. So i hope that SolidEdge had hard Coded this file location. so we cannot write the new configuration file for STP options and set that file location. So i hope only thing is to change STEP3D.INI file every time you want to change the STEP options. But if any sort program crash occurs then the options may not be restored, which we usually do after our program ends. So any other method available,so any other options availabel,plz revert..

 

 

Thanks

Venkata Ramesh V

 

Posted by: Venkata Ramesh Virodhula
Post date: 7/13/2011 11:27:26 PM

RE: How to Set Options in SolidEdge using C#

 

Hi Venkata,

 

as i already said, only DXF/DWG and IGES allow usage of custom ini files named and saved anywhere. The ini file location is kept in the current user's registry under the registry key: 

 

For DXF

"HKEY_CURRENT_USER\Software\Unigraphics Solutions\Solid Edge\Version XXX\FileTypes\SolidEdge.DraftDocument\FileFormats\.DXF\ConfigFile"

For DWG

 

 "HKEY_CURRENT_USER\Software\Unigraphics Solutions\Solid Edge\Version XXX\FileTypes\SolidEdge.DraftDocument\FileFormats\.DWG\ConfigFile"

 

For IGES

 

 "HKEY_CURRENT_USER\Software\Unigraphics Solutions\Solid Edge\Version XXX\FileTypes\SolidEdge.XXXXXDocument\FileFormats\.IGS\ConfigFile"

 

By setting the value for ConfigFile you may point to a customized ini file to be used for the DXF/DWG/IGES conversion.

The registry keys don't exist before first usage of an interactive conversion done using the option dialog.

The XXX version can be retrieved by using the Solid Edge InstallData COM object by executing the method GetMajorVersion.ToString().

 

All other conversions require their specific ini files to be manipulated directly by code (i.e. by the Win32 API methods). Which requires write permissions and yes, may result in changed and not reset to default values after a crash of your program.

 

Concerning the evaluation of the template to be used when importing IGES and/or STEP data you have to read the specifications of the IGES and STEP formats and implement some rules on your own. Be aware that IGES also supports 2D data.

 

P.S. By the way you should avoid cross postings all over the forum on the same issue(s).

 

 

Posted by: Wolfgang Kunert
Post date: 7/14/2011 9:57:34 PM

RE: How to Set Options in SolidEdge using C#

Thanks Wolfgang.

 

Posted by: Venkata Ramesh Virodhula
Post date: 7/18/2011 12:17:07 AM