-------------------------------------------------------------------------- 
Frequently Asked Questions
-------------------------------------------------------------------------- 

Q: How to configure the DLL project?
A: Step 1: Build an empty DLL project with Vsiual Studio 2010.

Step 2: Add project files. The following files should be added to the DLL project: VxApi.h : header file provided by ZW3D (The header file can be found in "api" folder of ZW3D install directory) zw3d.lib : library file provided by ZW3D (The library file can be found in ZW3D install directory) XXX.def : module definition file used to define interfaces that DLL exports XXX.c/XXX.cpp: source code files XXX.tcmd : resource files of ZW3D command (There's no necessary to add any .tcmd file to DLL project if the application has no need to show any command that has a ZW3D-style GUI.) XXX.ui : resource files of ZW3D-style command form or dialig (There's no necessary to add any .ui file to DLL project if the application has no need to show any ZW3D-style command form or dialig.) XXX.zcui : menu file. (There's no necessary to add any .zcui file to DLL project if developer does not need to show the new command in the menu.) XXX.png/XXX.bmp : icon file. zrc.exe : resource tool that compile your *.tcmd, *.ui, *.zcui and icon files into a binary data file named as XXX.zrc

Step 3: Specify module definition file.

-------------------------------------------------------------------------- Q: How to compile the resource files into a zrc file? A: Use the cmd.exe and specify the directory and output name to compile the resource files. For example, supposing your project directory is "D:\project", "cd" to ZW3D's install directory in cmd, and execute the command line "zrc.exe D:\project -o D:\project\XXX.zrc". zrc.exe will search your porject directory to find out all resource files(*.tcmd and so on). Please note that the zrc file name must be the same as the DLL file name. -------------------------------------------------------------------------- Q: Which folder shall I put the DLL and resource file in to let ZW3D load them when startup? A: Put the DLL and zrc to the apilibs folder in ZW3D install directory, which name is "apilibs". "apilibs" folder is not exist after installing ZW3D, developer need to create it manually. -------------------------------------------------------------------------- Q: How to debug the DLL project? A: Method 1: 1. Open the "Attach to Process" dialog via menu: "Tools" | "Attach to Process...".

2. Choose "zw3d.exe" from the available processes list and click "Attach" button.

Method 2: 1. Open the properties dialog of the project.

2. Enter the path of "zw3d.exe" at "Debugging" | "Command". Enter "_No_Debug_Heap=1" at "Debugging" | "Environment". Click "OK" button to save and apply configuration. Press "F5" key to start debugging.

-------------------------------------------------------------------------- Q: When executing the command, ZW3D shows "ALERT: Unable to find XXXXX: No such symbol" or "ALERT: [XXXXX] is not a valid command" in tip area, how to resolve the problem? A: There are several reasons for this problem to come into being: 1. The initialization function name is not correct and ZW3D can not find it when loading the DLL. The initialization function name must be the name of your DLL suffixed with "Init". For example, the initialized function name must be "DrawBoxInit" if the DLL name is "DrawBox". 2. The DLL does not export the functions. Third party developer need to declare DLL export functions in module definition file (.def file). 3. The command has not been registered. Third party developer need use cvxCmdFunc() to registering command. 4. If a command associate with a command file (.tcmd), call it with an exclamation point(!) prefix, else call it with a tilda(~) prefix. 5. If ZW3D fail in activing command with an exclamation point(!) prefix, it is possible that the zrc file does not in the apilibs folder or you forget to re-compile the resource files. -------------------------------------------------------------------------- Q: How to uninstall the DLL application? A: ZW3D load and unload Dll dynamically, so delete the DLL file and the other file(s) it uses can uninstall the DLL application completely. -------------------------------------------------------------------------- Q: How many DLL files ZW3D can load at the same time? A: Sixteen. -------------------------------------------------------------------------- Q: What is the registered command name? A: The registered command name is a keyword used to register function. The registered command name must be the same as the name used in command and UI file (XXX.tcmd and XXX.ui file). For example: cvxCmdFunc("CreateHole", (void*)ModelAddHole, VX_CODE_GENERAL); "CreateHole" is the registered command name. "ModelAddHole" is the implementation function pointer of command. VX_CODE_GENERAL indicates the operation type of command. -------------------------------------------------------------------------- Q: What is the maximum length of registered command name? A: No more than 15 ASCII characters. For example, "CreateMySurface" is a valid name while "CreateFilletFace" is not. -------------------------------------------------------------------------- Q: What's "Custom Feature"? What's difference from common feature? A: In ZW3D, developer can combine two or more features into one and the combined feature is custom feature. Using the following keyword in command file (XXX.tcmd) to declare the registered command name, and then all features created with "FilletBox" command will be combined into a custom feature: <property name="function">CustomOp</property> <property name="custom">FilletBox.c</property> "FilletBox" is the registered command name. the suffix ".c" indicates that implementation function related to the registered command is a C language function. The command template for a custom feature should include the parameter "op_type=X", where "X" is one of the following values. If "op_type" is not specified,"op_type=0" is used by default. -1 - Flag the feature as invisible in the history 0 - This feature's type is not classified (i.e. options 1, 2 or 11 do not apply) 1 - This feature modifies the visibility or display attributes of existing entities, including entities not explicitly referenced in the feature's input data. 2 - This feature may geometrically modify entities explicitly listed in the input data (this does not include entity deletions, unless a delete may modify an entity without completely moving it, like deleting a face from a shape). -2 - This option is the same as option 2 except that, like option 11, it prevents explicit entity picks from being cleaned from the feature's input data. 3 - Erase/Delete operation. This is treated as a special-case in code that traces feature networks. 11 - This feature does not modify entities explicitly referenced in its input data, but it may create new entities or modify entities not explicitly documented in the input data. THIS OPTION PREVENTS EXPLICIT ENTITY PICKS FROM BEING CLEANED FROM VDATA. 12 - This feature contains static geometry restored each time the feature is regenerated. The feature cannot be redefined. It has no parent dependencies, but downstream history operations can be dependent on it. -------------------------------------------------------------------------- Q: Why some API functions generate history while the other not? A: If the API function does not modify any entities like query or create a Z3 file, it won't generate history. In principle, if an operation will generate history through interact with ZW3D, the API function do the same operation will generate history too.