多尺度力学分享 http://blog.sciencenet.cn/u/thomaschoo2011 多尺度力学学习者

博文

建立你的第一个ACIS程序框架 windows console

已有 3186 次阅读 2011-4-6 19:22 |个人分类:开源库|系统分类:科研笔记| windows

Building as a Standalone ApplicationCreate a batch file which sets the following environment variables: A3DT, ARCH, and PATH. An example of such a batch file is shown below:BuildingStandAlone01.jpgChoose from the two options belowOption 1:Open the Visual Studio 2005 Command Prompt window by selecting: Start>All Programs>Microsoft Visual Studio 2005>Visual Studio Tools>Visual Studio 2005 Command Prompt.Drop the batch file created in the previous step into the command window and select Enter.BuildingStandAlone02.jpgOption 2:Add the following line to the batch file created in Step 1: C:Program FilesMicrosoft Visual Studio 8VCbinvcvars32.bat. An example of such a batch file is shown below and follow the next steps.BuildingStandAlone03.jpgSelect Start in the lower left corner of your screen.Select Run; this opens a new Run window:Type cmd in the window as shown below:BuildingStandAlone04.jpgDrag and drop the batch file created using the above steps in the newly launched command window.Choose Enter. This runs the batch file and sets the required paths needed to build an ACIS-based console application.Type devenv in the command window.Select File>New>Project or enter Ctrl+Shift+NSelect Win32 from the Visual C++ Option and Win32 Console Application from Templates; enter an appropriate name and location, and then select OK. This creates a stock project: for example,MyfirstAcisProjectBuildingStandAlone05.jpgThe Win32 Application Wizard pops up; select Next.From the menu Application Settings > Application, select "Console application". From Additional options, select "Empty project". Finally, select Finish.Under Project, select Add New Item….In the Add New Item window, select Code for the category.Choose C++ file (.cpp) as the template to use. Provide the desired name and location.Select Add.Next, setup the project settings. Open the Property Pages by selecting the project name under the Solution Explorer. Enter Alt-F7 or right click and select "Properties". The following image is a sample Project Properties screen. Note: Make certain that this is the properties screen for the project and not an item in the project.Now expand the Configuration Properties and select C/C++ from the resulting list.Select the Configuration Manager button and set the Active Solution configuration as follows and then select Close.Release (if ARCH=NT_VC8_DLL)Debug (if ARCH=NT_VC8_DLLD)Expand the C/C++ list and select General and enter $(A3DT)/include in the "Additional Include Directories" field.Next select the "Preprocessor" option from the C/C++ tree and append NT_VC8_DLL(or NT_VC8_DLLD), ACIS_DLL, SPA_NO_AUTO_LINK.Expand the "linker" tree and select the General option and enter $(A3DT)/lib/$(ARCH) in the "Additional Library Directories" field.Next select the Input option and enter the following libraries in the "Additional Dependencies" field: SPAAcis.lib SpaLicErrGUI.lib.Select Apply, then OK.Copy the code sample below into the CPP file.Select Build/Rebuild Solution (Ctrl+Alt+F7) .Your program is ready to use. Make certain to add the license key to begin making calls to the ACIS functions.Code to Copy into CPP File[show]Code to Copy into CPP File for Building as a Standalone Application
Licensing Headers
The following code is the licensing header and sample ACIS calls.
#include "license.hxx" #include "spa_unlock_result.hxx" #include "spa_lic_err_gui.hxx"
Sample ACIS calls to create a sphere and then to write it into a SAT file:
#include "position.hxx" #include "body.hxx" #include "cstrapi.hxx"   // SAMPLE // Create an Entity List to add entities ENTITY_LIST entityList;   // Create Sphere // BODY* sphere = NULL; api_solid_sphere(SPAposition(30, 30, 30), 10, sphere,NULL); entityList.add(sphere);   // Create sat File // create_sat_file (entityList, "MyFirstAcisProject.sat"); // End SAMPLE

https://wap.sciencenet.cn/blog-535627-430261.html

上一篇:随机矩阵 好东西啊
下一篇:介绍gaussian 随机矩阵的一篇文章
收藏 IP: 222.26.180.*| 热度|

0

发表评论 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-15 06:00

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部