MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
CAD4FE_api_sw_tool.h
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// CAD4FE_api_sw_tool.h
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:56 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #ifndef CAD4FE_api_sw_toolh
23 #define CAD4FE_api_sw_toolh
24 
25 #include <vector>
26 #include <map>
27 
28 #if defined(USING_ATL)
29 #include <atl\atlvcl.h>
30 #endif
31 #include <Atl/atlbase.h>
32 #include <Atl/atlmod.h>
33 #include <SwConst_TLB.h>
34 #define SW_VERSION 2012
35 #include <SldWorks_TLB.h>
36 #include <smartvars.h>
37 
38 #ifdef __BORLANDC__
39 using namespace Sldworks_tlb;
40 #endif
41 
42 
43 CAD4FE_COMMON_ITEM void SW_CoCreateInstance(CComPtr<ISldWorks> & __swApp);
44 CAD4FE_COMMON_ITEM void SW_ExitApp(CComPtr<ISldWorks> & __swApp);
45 CAD4FE_COMMON_ITEM void SW_App_CreateBoundaryConditionAttributeDef(CComPtr<ISldWorks> & __swApp, CComPtr <IAttributeDef> & DefAttrConditionLimite);
46 CAD4FE_COMMON_ITEM int SW_OpenDoc(const CComPtr<ISldWorks> & __swApp, char *filename, CComPtr<IModelDoc2>& __swModel, char __configuration[]="");
47 CAD4FE_COMMON_ITEM void SW_CloseDoc(CComPtr<IModelDoc2>& __swModel);
48 CAD4FE_COMMON_ITEM void SW_CloseDoc(const CComPtr<ISldWorks> & __swApp, char *filename);
49 CAD4FE_COMMON_ITEM void SW_GetActiveDoc(const CComPtr<ISldWorks> & __swApp, CComPtr<IModelDoc2> &__swModel);
50 CAD4FE_COMMON_ITEM DWORD WINAPI SW_App_SendMsgToUser_Ok(void * pointerSW);
51 
52 CAD4FE_COMMON_ITEM void SW_RibFeature_GetDefinition(CComPtr<IFeature> __swFeature, CComPtr<IRibFeatureData2> & __swFeatData);
53 CAD4FE_COMMON_ITEM int SW_Feature_TestAttribute(CComPtr<IFeature> & __swFeature,CComPtr <IAttributeDef> &);
54 CAD4FE_COMMON_ITEM int SW_Feature_Select(CComPtr<IFeature> __swFeature, CComPtr <ISelectData> __swSelData);
55 CAD4FE_COMMON_ITEM template <class T>
56 void SW_Feature_GetDefinition(CComPtr<IFeature> __swFeature, CComPtr<T> & __swFeatData);
57 CAD4FE_COMMON_ITEM int SW_Feature_Suppress(CComPtr<IModelDoc2> & __swModel, CComPtr<IFeature> & __swFeature);
58 CAD4FE_COMMON_ITEM void SW_Feature_GetBoundingBox (CComPtr<IModelDoc2> & __swModel, CComPtr<IFeature> & __swFeature, double __bbox[6]);
59 
60 CAD4FE_COMMON_ITEM void
61 SW_Feature_GetProjectionPlane(CComPtr<IFeature> swFeature, double planeRootPoint[3], double planeNormal[3]);
62 
63 CAD4FE_COMMON_ITEM void
64 SW_Feature_GetProjectionPlane2(CComPtr<IFeature> __swFeature, CComPtr<IModelDoc2> __swModel, double planeRootPoint[3], double planeNormal[3]);
65 CAD4FE_COMMON_ITEM void
66 SW_Feature_GetPoint(CComPtr<IFeature> & pFeature, double xyzFeature[3]);
67 CAD4FE_COMMON_ITEM bool SW_Feature_IsSuppressed(CComPtr<IModelDoc2> & __swModel, CComPtr<IFeature> & __swFeature);
68 
69 
70 CAD4FE_COMMON_ITEM void SW_SimpleFilletFeature_GetDefinition(CComPtr<IFeature> __swFeature, CComPtr<ISimpleFilletFeatureData2> & __swFeatData);
71 CAD4FE_COMMON_ITEM double SW_SimpleFilletFeatureData_GetRadius( CComPtr<ISimpleFilletFeatureData2> __swFeatData );
72 CAD4FE_COMMON_ITEM int SW_SimpleFilletFeatureData_GetItemsCount(CComPtr<ISimpleFilletFeatureData2> __swFeatData);
73 CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_ReleaseSelectionAccess(CComPtr<ISimpleFilletFeatureData2> __swFeatData);
74 CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_AccessSelections(CComPtr<ISimpleFilletFeatureData2> __swFeatData, CComPtr<IModelDoc2> __swModel);
75 CAD4FE_COMMON_ITEM std::multimap<int, CComPtr < IEdge > > SW_GetItemEdges(LPUNKNOWN punk_item);
76 CAD4FE_COMMON_ITEM std::multimap<int, CComPtr < IEdge > > SW_Loop_GetEdges(CComPtr<ILoop2> __swLoop);
77 CAD4FE_COMMON_ITEM std::multimap<int, CComPtr < IEdge > > SW_Face_GetEdges(CComPtr<IFace2> __swFace);
78 CAD4FE_COMMON_ITEM int SW_Face_GetMaterialProperties(CComPtr <IFace2> & swFace, std::vector <double> & );
79 CAD4FE_COMMON_ITEM int SW_Face_GetMaterialProperties(CComPtr <IFace2> & swFace, unsigned char rgba[4]);
80 CAD4FE_COMMON_ITEM double SW_SimpleFilletFeatureData_GetRadiusAtItem(CComPtr<ISimpleFilletFeatureData2> __swFeatData, LPUNKNOWN __item);
81 CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_GetItemAtIndex(CComPtr<ISimpleFilletFeatureData2> __swFeatData, int __index, LPUNKNOWN & __item);
82 
83 CAD4FE_COMMON_ITEM void SW_ChamferFeature_GetDefinition(CComPtr<IFeature> __swFeature, CComPtr<IChamferFeatureData2> & __swFeatData);
84 CAD4FE_COMMON_ITEM void SW_ChamferFeatureData_GetAngleDistance (CComPtr<IChamferFeatureData2> &swFeatData, double * angle, double * distance);
85 
86 
87 CAD4FE_COMMON_ITEM void SW_Face_GetBox(CComPtr<IFace2> __swFace, double __bbox[6]);
88 CAD4FE_COMMON_ITEM void SW_Face_GetBoxTessellation(CComPtr<IFace2> & __swFace, double __bbox[6]);
89 CAD4FE_COMMON_ITEM long SW_Face_GetLoopCount(CComPtr<IFace2> __swFace);
90 CAD4FE_COMMON_ITEM int SW_Face_TestAttribute(CComPtr<IFace2> & __swFace,CComPtr <IAttributeDef> &);
91 void
92 SW_Face_GetProjectionPlane(CComPtr <IFace2> selectedFace1, double __rootPoint[3], double __normal[3]);
93 
94 void
95 SW_Face_CreateTangentPlaneAtCenter(CComPtr<IModelDoc2> __swModel, CComPtr <IFace2> __swFace, double __rootPoint[3], double __XVector[3], double __normal[3],
96 CComPtr<IRefPlane> & __swRefPlane );
97 CAD4FE_COMMON_ITEM int SW_Face_IsRevolved(CComPtr<IFace2> __swFace);
98 CAD4FE_COMMON_ITEM void
99 SW_Face_ClosetPointOnContour(CComPtr<IFace2> __swFace, double __point[3], double __result[3]);
100 CAD4FE_COMMON_ITEM int SW_Face_ReverseEvaluate0(CComPtr<IFace2> __swFace, double __pos[3], double __uv[2]);
101 CAD4FE_COMMON_ITEM void SW_Face_GetCenterPoint(CComPtr<IFace2> __swFace, CComPtr<IModelDoc2> __swModel, double __result[3]);
102 CAD4FE_COMMON_ITEM
103 void
104 SW_Face_GetClosestPointOn(CComPtr<IFace2> __swFace, double __point[3], double __result[3]);
105 CAD4FE_COMMON_ITEM int SW_Face_GetId(CComPtr<IFace2> __swFace);
106 CAD4FE_COMMON_ITEM int SW_FaceEdge_UVBox (CComPtr <IEdge> edge, CComPtr <IFace2> face, double startUV[2], double endUV[2]);
107 CAD4FE_COMMON_ITEM int SW_Face_GetUVBounds (CComPtr <IFace2> face, double *bbox);
108 CAD4FE_COMMON_ITEM bool SW_Face_IsUPeriodic(CComPtr <IFace2> face);
109 CAD4FE_COMMON_ITEM bool SW_Face_IsVPeriodic(CComPtr <IFace2> face);
110 
111 void
112 CAD4FE_COMMON_ITEM SW_Surface_Parameterization(CComPtr<ISurface> __swSurface, double __uRange[2], double __vRange[2], int __uBoundType[2], int __vBoundType[2], int __uProps[4], int __vProps[4], int __numProps[2]);
113 
114 CAD4FE_COMMON_ITEM
115 void
116 SW_FindCommonVertexBetweenTwoAdjacentEdges (CComPtr<IEdge> __swEdge1, CComPtr<IEdge> __swEdge2, CComPtr<IVertex> & __swVertex);
117 /*
118 * Get the 3D coordinates and tangent direction of
119 * the extremities points of the SW edge
120 */
121  // If SenseFlag is TRUE, then the curve and edge are in the same direction.
122  // If SenseFlag is FALSE, then the curve and edge are in opposite directions
123 CAD4FE_COMMON_ITEM int SW_Edge_GetParameters (CComPtr<IEdge> __swEdge, double *__startUParam, double *__endUParam, double *__startPt, double *__endPt, double *__startTanDir, double *__endTanDir,int *_curveType,int *_senseFlag);
124 CAD4FE_COMMON_ITEM int SW_Edge_Select(CComPtr<IEdge> __swEdge, CComPtr <ISelectData> __swSelData);
125 CAD4FE_COMMON_ITEM void SW_Edge_GetBody(CComPtr<IEdge> __swEdge, CComPtr<IBody2> & __swBody);
126 CAD4FE_COMMON_ITEM void SW_Edge_EvaluateAtVertex(CComPtr<IEdge> __swEdge, CComPtr<IVertex> __swVertex, double __point[3], double __tangent[3]);
127 CAD4FE_COMMON_ITEM int SW_Edge_TestAttribute(CComPtr<IEdge> & __swEdge,CComPtr <IAttributeDef> &);
128 void SW_Edge_GetClosestPointOn(CComPtr<IEdge> __swEdge, double __point[3], double __result[3]);
129 double SW_Edge_GetDistanceToPoint(CComPtr<IEdge> __swEdge, double __point[3]);
130 CAD4FE_COMMON_ITEM
131 void
132 SW_Edge_GetTangentEdgesPropagation2 (CComPtr <IEdge> __swEdge, std::multimap <int, CComPtr < IEdge > > & __tangentEdges, int & __maxEdgeId);
133 
134 /*
135 * This function returns the coordinates and the tangent of a point on a
136 * curve at a specified U parameter
137 */
138 CAD4FE_COMMON_ITEM int SW_Curve_Evaluate(CComPtr <ICurve> curve, double U, double point[3], double tangent[3]);
139 CAD4FE_COMMON_ITEM long SW_Curve_GetIdentity(CComPtr<ICurve> __swCurve);
140 CAD4FE_COMMON_ITEM bool SW_Curve_IsCircle(CComPtr<ICurve> __swCurve);
141 CAD4FE_COMMON_ITEM bool SW_Curve_IsLine(CComPtr<ICurve> __swCurve);
142 CAD4FE_COMMON_ITEM bool SW_Curve_IsBspline(CComPtr<ICurve> __swCurve);
143 
144 
145 CAD4FE_COMMON_ITEM void SW_Edge_EvaluateCurvilinearDistancePoint(CComPtr<IEdge> __swEdge,
146  CComPtr<IVertex> __swVertex,
147  double __L,
148  double *__LResult,
149  double *__t,
150  double __X[3]
151  );
152 
153 CAD4FE_COMMON_ITEM void SW_Edge_Tessellate(CComPtr<IEdge> & __swEdge,
154  double __startPnt[3],
155  double __endPnt[3],
156  std::vector<double> & __result);
157 CAD4FE_COMMON_ITEM void
158 SW_Edge_Tessellate(CComPtr<IEdge> & __swEdge, double __maxSize, std::vector<double> & __result);
159 CAD4FE_COMMON_ITEM void
160 SW_Edge_Tessellate(CComPtr<IEdge> & __swEdge, double __uStart, double __uEnd, std::vector<double> & __result);
161 
162 /* Reverse evaluate the face at a given 3D point
163 * arg1 : SW face
164 * arg2 : 3D coordinates of the point to reverse-evaluate
165 * arg3 : 3D vector to output the normal direction at this point
166 * arg4 : 3D vector to output the first principal direction
167 * arg5 : 3D vector to output the second principal direction
168 * arg6 : 3D vector to output the first principal curvature
169 * arg7 : 3D vector to output the second principal curvature
170 */
171 CAD4FE_COMMON_ITEM void SW_Face_EvaluateAtPoint(CComPtr<IFace2> __swFace,
172  double __pos[3],
173  double* __faceNormal, // Array of 3 doubles
174  double *__firstPrincipalDirection=NULL, // (optional) Array of 3 doubles
175  double *__secondPrincipalDirection=NULL, // (optional) Array of 3 doubles
176  double *__firstPrincipalCurvature=NULL, // (optional) pointer to 1 double
177  double *__secondPrincipalCurvature=NULL // (optional) pointer to 1 double
178  );
179 
180 CAD4FE_COMMON_ITEM int SW_Face_Select(CComPtr<IFace2> __swFace, CComPtr <ISelectData> __swSelData);
184 void SW_Edge_GetBody(CComPtr<IEdge> __swEdge, CComPtr<IBody2> & __swBody);
185 
190 CAD4FE_COMMON_ITEM void SW_Body_MaxEdgeId(CComPtr<IBody2> __swBody, int * __id);
191 CAD4FE_COMMON_ITEM void SW_Body_GetBodyBox(CComPtr<IBody2> __swBody, double __bbox[6]);
205 CAD4FE_COMMON_ITEM void
206 SW_Body_GetBodyBox(CComPtr<IBody2> __swBody, double __lowerDiagCorner[3], double __upperDiagCorner[3]);
207 
208 CAD4FE_COMMON_ITEM void SW_Edge_SetId(CComPtr <IEdge> __swEdge, int id);
209 
210 CAD4FE_COMMON_ITEM int SW_Edge_GetId(CComPtr <IEdge> __swEdge);
211 
212 /*
213 * This function returns the coordinates and the tangent of a point on an
214 * edge at a specified U parameter
215 */
216 CAD4FE_COMMON_ITEM int SW_Edge_Evaluate(CComPtr<IEdge> edge, double U, double point[3], double tangent[3]);
217 CAD4FE_COMMON_ITEM int SW_Edge_Evaluate_CheckDomain(CComPtr<IEdge> edge, double U, double point[3], double tangent[3]);
218 CAD4FE_COMMON_ITEM int SW_Edge_Evaluate_CheckDomain(CComPtr<IEdge> edge, double StartUParam, double EndUParam, double U, double point[3], double tangent[3]);
219 
220 
221 /*
222 * This function gets the closest point from arg2 on the SW edge and
223 * returns its parametric position (arg3), and 3D tangent direction (arg4)
224 */
225 CAD4FE_COMMON_ITEM void SW_Edge_ReverseEvaluate(CComPtr<IEdge> __swEdge, double __pos[3], double *__u, double __tanDir[3]);
226 /*
227 * This function gets the closest point from arg2 on the SW edge and
228 * returns its parametric position (arg3)
229 */
230 void
231 SW_Edge_ReverseEvaluate(CComPtr<IEdge> __swEdge, double __pos[3], double *__u);
232 
233 /*
234 * This function returns the U parametric range of an edge
235 */
236 CAD4FE_COMMON_ITEM void SW_GetEdgeBounds(CComPtr<IEdge> __swEdge, double *__startParam, double *__endParam);
237 
238 /*
239 * This function returns the U parametric range of an edge
240 * AND the start and end points !
241 */
242 CAD4FE_COMMON_ITEM void SW_GetEdgeBounds(CComPtr<IEdge> __swEdge, double *__startParam, double *__endParam, double __startPnt[3], double __endPnt[3]);
243 
244 /*
245 * this function calculates the curvilinear length of an edge
246 */
247 CAD4FE_COMMON_ITEM double SW_Edge_GetLength(CComPtr<IEdge> __swEdge);
248 
249 /*
250 * This function the position of the point on the surface at parameters U and V
251 * its normal, and its tangent directions along U and V iso-parametric curves
252 */
253 CAD4FE_COMMON_ITEM int SW_Surface_Evaluate1(CComPtr<ISurface> surface, double U, double V, double point[3], double DU[3], double DV[3], double normal[3]);
254 /*
255 * This function the position of the point on the face at parameters U and V
256 * its normal, and its tangent directions along U and V iso-parametric curves
257 */
258 CAD4FE_COMMON_ITEM int SW_Surface_Evaluate1(CComPtr<IFace2> face, double U, double V, double point[3], double DU[3], double DV[3], double normal[3]);
259 
260 CAD4FE_COMMON_ITEM void
261 SW_Face_RandomCreatePoint ( CComPtr<IFace2> __swFace, double __uvBounds[4], double __result[3]);
262 
263 CAD4FE_COMMON_ITEM void
264 SW_Face_Evaluate0 ( CComPtr<IFace2> __swFace, double uv[2], double __result[3]);
265 
266 CAD4FE_COMMON_ITEM int SW_Surface_Evaluate2(CComPtr<ISurface> surface,
267  double U, double V, double evaluatedPoint[3],
268  double DerU[3], double DerV[3], double DerUV[3], double DerUU[3], double DerVV[3],
269  double normal[3],
270  int *numUDerivs, int *numVDerivs,
271  long *surfIdentity);
272 CAD4FE_COMMON_ITEM int SW_Surface_Evaluate2(CComPtr<IFace2> __swFace,
273  double U, double V, double evaluatedPoint[3],
274  double DerU[3], double DerV[3], double DerUV[3], double DerUU[3], double DerVV[3],
275  double normal[3],
276  int *numUDerivs, int *numVDerivs,
277  long *surfIdentity);
278 
279 CAD4FE_COMMON_ITEM int SW_Surface_Evaluate3(CComPtr<ISurface> surface,
280 double U, double V, double evaluatedPoint[3],
281 double DerU[3], double DerV[3], double DerUV[3], double DerUU[3], double DerVV[3],
282 double normal[3],
283 int *numUDerivs, int *numVDerivs,
284 long surfIdentity = -516);
285 /*
286 * This function returns the UV parametric coordinates of the face of a point lying
287 * on an edge
288 */
289 CAD4FE_COMMON_ITEM int SW_FaceEdge_ReverseEvaluate(CComPtr<IEdge> edge, CComPtr<IFace2> face, double U, double UV[2]);
290 
295 CAD4FE_COMMON_ITEM double * swEdgeGetTessPts (CComPtr<IEdge> & __swEdge, int *__size,
296  double nChordTol = 0.000001,
297  double nLengthTol = 0.000001);
298 
299 
300 CAD4FE_COMMON_ITEM void SW_Sketch_GetPlaneParams(CComPtr<ISketch> & __swSketch,
301  double __origin[3], double __normal[3], double __XVector[3]);
302 
307 CAD4FE_COMMON_ITEM void
308 SW_SketchSegment_GetTessPts (CComPtr<ISketchSegment> & __swSketchSegment, double *__tessPts, int *__size,
309  double nChordTol = .001,
310  double nLengthTol = .001);
311 
319 CAD4FE_COMMON_ITEM void SW_Face_GetTessTriangles (CComPtr<IFace2> __swFace, long *__triangleCount, SafeDoubleArray **);
320 CAD4FE_COMMON_ITEM void SW_Face_GetTessTriangles (CComPtr<IFace2> __swFace, long *__triangleCount, double ** __tessPts);
321 
322 CAD4FE_COMMON_ITEM int SW_CoEdge_GetFaceInteriorDirection(CComPtr<IEdge> __swEdge, CComPtr<IFace2> __swFace, double __X[3], double __D[3]);
323 
324 /* std::map < int,
325  CComPtr < IFace2 >
326  >
327 CAD4FE_COMMON_ITEM SW_GetEdgeFaces(CComPtr<IEdge> __swEdge);*/
328 void
329 CAD4FE_COMMON_ITEM SW_GetEdgeFaces(CComPtr<IEdge> __swEdge, CComPtr<IFace2> & __swFace1, CComPtr<IFace2> & __swFace2);
330 
331 CAD4FE_COMMON_ITEM void SW_EvaluateClosestPointOnFace(CComPtr<IFace2> __swFace,
332  double __pos[3],
333  double *__facePos, // Array of 3 doubles
334  double *__uParams, // Array of 1 double
335  double *__vParams
336  );
337 
338 CAD4FE_COMMON_ITEM void SW_EvaluateClosestPointOnFace(CComPtr<IFace2> __swFace,
339  double __pos[3],
340  double *__X3D, // 3D position
341  double *__X2D // parametric position
342  );
343 CAD4FE_COMMON_ITEM void SW_EvaluateClosestPointOnSurface(CComPtr<ISurface> __swSurface,
344  double __pos[3],
345  double __facePos[3], // Array of 3 doubles
346  double __uvParams[2] // Array of 2 doubles
347  );
348 
349 template < class T >
350 void SW_Select_and_Mark(CComPtr< T > __swT, bool __append, long __mark)
351 {
352  VARIANT_BOOL retval;
353  CComQIPtr <Sldworks_tlb::IEntity> swQIEnt ( __swT );
354 
355  VARIANT_BOOL Append = __append ? 1 : 0;
356  swQIEnt->Select2(Append, __mark, &retval);
357 }
358 
359 CAD4FE_COMMON_ITEM void SW_Face_Select_and_Mark(CComPtr<IFace2> __swFace, bool __append, long __mark);
360 CAD4FE_COMMON_ITEM void SW_Sketch_Select_and_Mark(CComPtr<ISketch> __sketch, bool __append, long __mark);
361 CAD4FE_COMMON_ITEM void SW_Sketch_GetModelCoordinateInSketchSpace(CComPtr<ISketch> __sketch, double __pos_3D[3], double __pos_sketch[3]);
362 CAD4FE_COMMON_ITEM void SW_Sketch_GetModelCoordinateInSketchSpace(CComPtr<ISketch> __sketch, double __pos_sketch[3], double __pos_3D[3]);
363 
364 CAD4FE_COMMON_ITEM void SW_GetActiveView (CComPtr<IModelDoc2> __swModel, CComPtr<IModelView> & __swModelView);
365 CAD4FE_COMMON_ITEM bool SW_Face_GetMaterialPropertyValues2(CComPtr<IFace2> __swFace, double *R, double *G, double *B, double *ambient, double *diffuse, double *specular, double *shininess, double *transparency, double *emission);
366 CAD4FE_COMMON_ITEM bool SW_SelectedEdgeProperties(CComPtr<IModelDoc2> __swModel, CComPtr<IEdge> __swEdge, std::string & __retName, bool & name_existed_before);
367 CAD4FE_COMMON_ITEM bool SW_SelectedEdgeProperties(CComPtr<IModelDoc2> __swModel, CComPtr<IEdge> __swEdge, char * &,bool & name_existed_before);
368 CAD4FE_COMMON_ITEM bool SW_SelectedFaceProperties(CComPtr<IModelDoc2> __swModel, CComPtr<IFace2> __swFace, char * & __retName, bool & name_existed_before);
369 CAD4FE_COMMON_ITEM bool SW_SelectedFaceProperties(CComPtr<IModelDoc2> __swModel, CComPtr<IFace2> __swFace, std::string & __retName, bool & name_existed_before);
370 CAD4FE_COMMON_ITEM bool SW_Face_NameById(CComPtr<IModelDoc2> __swModel, CComPtr<IFace2> __swFace, int & __id, bool & name_existed_before);
371 CAD4FE_COMMON_ITEM bool SW_Edge_NameById(CComPtr<IModelDoc2> __swModel, CComPtr<IEdge> __swEdge, int & __id, bool & name_existed_before);
372 CAD4FE_COMMON_ITEM void SW_Model_GetActiveCameraPosition (CComPtr<IModelDoc2> __swModel, double __result[3]);
373 CAD4FE_COMMON_ITEM void SW_Model_AddConfiguration(CComPtr<IModelDoc2> & __swModel, std::string __strname, CComPtr<IConfiguration> & __result);
374 CAD4FE_COMMON_ITEM bool SW_Model_SuppressConfiguration(CComPtr<IModelDoc2> & __swModel, std::string __name);
375 CAD4FE_COMMON_ITEM bool SW_SelectedEdgeProperties(CComPtr<IModelDoc2> __swModel, CComPtr<IEdge> __swEdge, char * & __retName, bool & name_existed_before);
376 
377 CAD4FE_COMMON_ITEM CComPtr<IPartDoc> & SW_Model_GetPart(CComPtr<IModelDoc2> __swModel);
378 CAD4FE_COMMON_ITEM void SW_Model_GetActiveViewTranslation(CComPtr<IModelDoc2> __swModel, double __result[3]);
379 CAD4FE_COMMON_ITEM void SW_Model_SetAddToDB(CComPtr<IModelDoc2> __swModel, bool __status);
383 CAD4FE_COMMON_ITEM void SW_Model_CreateLineInSketch (CComPtr<IModelDoc2> __swModel, CComPtr<ISketch> __swSketch, double __P0[3], double __P1[3]);
384 CAD4FE_COMMON_ITEM int SW_Sketch_Select(CComPtr<ISketch> __swSketch, CComPtr <ISelectData> __swSelData);
385 CAD4FE_COMMON_ITEM int SW_SketchSegment_Select(CComPtr<ISketchSegment> __swSketchSegment, CComPtr <ISelectData> __swSelData);
386 CAD4FE_COMMON_ITEM int SW_SketchPoint_Select(CComPtr<ISketchPoint> __swSketchPoint, CComPtr <ISelectData> __swSelData);
387 CAD4FE_COMMON_ITEM void SW_Model_InsertSplitLine ( CComPtr<IModelDoc2> __swModel, CComPtr<ISketch> __swSketch, CComPtr<IFace2> __swFace,
388  std::map < int, CComPtr<IFace2> > & __resultFaces );
389 CAD4FE_COMMON_ITEM void SW_Model_InsertSplitLine(CComPtr<IModelDoc2> __swModel,
390  CComPtr<IFace2> __swFace, double __vertex1coordinates[3], double __vertex2coordinates[3],
391  std::map < int, CComPtr<IFace2> > & __resultFaces);
392 CAD4FE_COMMON_ITEM void
393 SW_Model_CreateRefPlane(CComPtr<IModelDoc2> __swModel, double __rootPoint[3], double __normal[3], CComPtr<IRefPlane> & __swRefPlane );
413  template <class T>
414 CAD4FE_COMMON_ITEM CComPtr<T> & SW_Model_GetFirstSelected(CComPtr <IModelDoc2> __swModel, long __mark)
415 {
416  CComPtr<T> * __swEnt = new CComPtr<T>;
417  HRESULT hr;
418  CComPtr <ISelectionMgr> swSelMgr;
419 
420  __swModel->get_ISelectionManager ( &swSelMgr );
421 
422  CComPtr <IDispatch> pUnk1;
423 
424  long count=0;
425  swSelMgr->GetSelectedObjectCount(&count);
426 
427  for (int i=1; i <= count ; i++)
428  {
429  pUnk1 = NULL;
430  if ( S_OK != swSelMgr->GetSelectedObject6 (i, __mark, &pUnk1) )
431  {
432  *__swEnt = 0;
433  return *__swEnt;
434  }
435  if (!pUnk1)
436  {
437  *__swEnt = 0;
438  return *__swEnt;
439  }
440  CComQIPtr<T> qiSelectedEnt (pUnk1);
441  CComPtr<T> selectedEnt (qiSelectedEnt);
442 
443  if (selectedEnt)
444  {
445  *__swEnt = selectedEnt;
446  return *__swEnt;
447  }
448  }
449 
450  *__swEnt = 0;
451 
452  return *__swEnt;
453 }
454 
455 
456  template <class T>
457 CAD4FE_COMMON_ITEM CComPtr<T> & SW_Model_GetSelected(CComPtr <IModelDoc2> __swModel, long __nth, long __mark)
458 {
459  HRESULT hr;
460  CComPtr <ISelectionMgr> swSelMgr;
461  CComPtr<T> * __swEnt = new CComPtr<T>;
462 
463  __swModel->get_ISelectionManager ( &swSelMgr );
464 
465  CComPtr <IDispatch> pUnk1;
466 
467  long count=0;
468  swSelMgr->GetSelectedObjectCount(&count);
469 
470  long counter = 0;
471 
472  for (int i=1; i <= count ; i++)
473  {
474  pUnk1 = NULL;
475  if ( S_OK != swSelMgr->GetSelectedObject6 (i, __mark, &pUnk1) )
476  {
477  __swEnt = 0;
478  return *__swEnt;
479  }
480  if (!pUnk1)
481  {
482  __swEnt = 0;
483  return *__swEnt;
484  }
485  CComQIPtr<T> qiSelectedEnt (pUnk1);
486  CComPtr<T> selectedEnt (qiSelectedEnt);
487 
488  if (selectedEnt)
489  {
490  if (counter+1 == __nth)
491  {
492  *__swEnt = selectedEnt;
493  return *__swEnt;
494  }
495  else
496  {
497  counter++;
498  }
499  }
500  }
501  *__swEnt = 0;
502 
503  return *__swEnt;
504 }
505 
506 CAD4FE_COMMON_ITEM int SW_GetSelecteEdgeId(CComPtr<ISldWorks> __swApp);
507 
508 
509 template <class T>
510 void SW_Feature_GetDefinition(CComPtr<IFeature> __swFeature, CComPtr<T> & __swFeatData)
511 {
512  HRESULT hres;
513  LPUNKNOWN iUnk = NULL;
514 
515  hres = __swFeature->IGetDefinition( &iUnk );
516  hres = iUnk->QueryInterface( __uuidof(T), (LPVOID*)&__swFeatData);
517 }
518 
523 CAD4FE_COMMON_ITEM void SW_Part_InitIDs(CComPtr<IPartDoc> __swPart);
524 
525 CAD4FE_COMMON_ITEM int
526 SW_Part_GetBodiesCount(CComPtr<IPartDoc> __swPart, swBodyType_e __swBodyType, bool __onlyVisibleBodies=true);
527 
528 CAD4FE_COMMON_ITEM CComPtr<IBody2> &
529 SW_Part_GetBody(CComPtr<IPartDoc> __swPart, int __index, swBodyType_e __swBodyType, bool __onlyVisibleBodies=true);
530 
534 CAD4FE_COMMON_ITEM void
535 SW_Model_SaveToFile(CComPtr<IModelDoc2> __swModel, const char * __filename);
540 CAD4FE_COMMON_ITEM void SW_Part_FindEdgeById(CComPtr<IPartDoc> __swPart, int __id, CComPtr <IEdge> & __swEdge);
545 CAD4FE_COMMON_ITEM void SW_Part_FindFaceById(CComPtr<IPartDoc> __swPart, int __id, CComPtr <IFace2> & __swFace);
546 
547 CAD4FE_COMMON_ITEM void SW_Vertex_GetPoint(CComPtr<IVertex> __swVertex, double __pnt[3]);
548 CAD4FE_COMMON_ITEM int SW_Vertex_GetId(const CComPtr <IVertex> & __swVertex);
549 
550 CAD4FE_COMMON_ITEM int SW_Vertex_TestAttribute(CComPtr<IVertex> & __swVertex,CComPtr <IAttributeDef> &);
551 CAD4FE_COMMON_ITEM bool SW_Face_IsCylinder(CComPtr<IFace2> __swFace);
552 CAD4FE_COMMON_ITEM bool SW_Surface_IsCylinder(CComPtr<ISurface> __swSurface);
553 CAD4FE_COMMON_ITEM bool SW_Face_IsCone(CComPtr<IFace2> __swFace);
554 CAD4FE_COMMON_ITEM bool SW_Surface_IsCone(CComPtr<ISurface> __swSurface);
555 CAD4FE_COMMON_ITEM bool SW_Face_IsPlane(CComPtr<IFace2> __swFace);
556 CAD4FE_COMMON_ITEM bool SW_Surface_IsPlane(CComPtr<ISurface> __swSurface);
557 CAD4FE_COMMON_ITEM bool SW_Face_IsTorus(CComPtr<IFace2> __swFace);
558 CAD4FE_COMMON_ITEM bool SW_Surface_IsTorus(CComPtr<ISurface> __swSurface);
559 CAD4FE_COMMON_ITEM bool SW_Face_IsSphere(CComPtr<IFace2> __swFace);
560 CAD4FE_COMMON_ITEM bool SW_Surface_IsSphere(CComPtr<ISurface> __swSurface);
561 CAD4FE_COMMON_ITEM bool SW_Face_IsSwept(CComPtr<IFace2> __swFace);
562 CAD4FE_COMMON_ITEM bool SW_Surface_IsSwept(CComPtr<ISurface> __swSurface);
563 
564 
568 CAD4FE_COMMON_ITEM void
569 SW_RefPlane_GetParams (CComPtr<IRefPlane> __swRefPlane, double __origin[3], double __normal[3], double __XVector[3]);
570 
571 
572 #define FACENAME_FORMAT "F %d "
573 #define FACENAME_STRLEN 64
574 #define EDGENAME_FORMAT "E %d "
575 #define EDGENAME_STRLEN 64
576 #define VERTEXNAME_FORMAT "Vertex %f, %f, %f "
577 #define VERTEXNAME_STRLEN 64
578 int CAD4FE_COMMON_ITEM Convert_FaceNameToId(std::string);
579 int CAD4FE_COMMON_ITEM Convert_FaceNameToId(char *);
580 int CAD4FE_COMMON_ITEM Convert_FaceNameToId(BSTR);
581 
582 bool CAD4FE_COMMON_ITEM SW_FaceName_Set(CComPtr<IPartDoc> __swPart, CComPtr<IFace2>, std::string &, bool overwrite_option=false);
583 bool CAD4FE_COMMON_ITEM SW_FaceName_Set(CComPtr<IPartDoc> __swPart, CComPtr<IFace2>, char *, bool overwrite_option=false);
584 
585 bool CAD4FE_COMMON_ITEM SW_FaceName_Get(CComPtr<IPartDoc> __swPart, CComPtr<IFace2>, std::string &);
586 bool CAD4FE_COMMON_ITEM SW_FaceName_Get(CComPtr<IPartDoc> __swPart, CComPtr<IFace2>, char **);
587 
588 
589 CAD4FE_COMMON_ITEM int
590 SW_Model_RayIntr_GetFirstFaceIntr(CComPtr<IModelDoc2> __swModel, double __basePointIn[3],
591 double __baseDirectionIn[3],
592 CComPtr<IFace2> & __swFace, double __intrPoint[3], double __intrPointNorm[3]);
593 
594 CAD4FE_COMMON_ITEM void SW_MathVector_ConvertToPoint(CComPtr<IMathVector> __swMathVector,CComPtr<IMathPoint> &__swMathPoint);
595 
596 
597 CAD4FE_COMMON_ITEM void
598 SW_MathPoint_GetCoordinates(CComPtr<IMathPoint> __swMathPoint, double __pos[3]);
599 
600 void
601 SW_RefPoint_GetPoint(CComPtr<IRefPoint> __swRefPoint, double __result[3]);
602 
603 CAD4FE_COMMON_ITEM void SW_ModelView_GetTranslation(CComPtr<IModelView> __swModelView, double __result[3]);
604 
605 
606 int CAD4FE_COMMON_ITEM Convert_EdgeNameToId(std::string);
607 int CAD4FE_COMMON_ITEM Convert_EdgeNameToId(char *);
608 int CAD4FE_COMMON_ITEM Convert_EdgeNameToId(BSTR);
609 
610 bool CAD4FE_COMMON_ITEM SW_EdgeName_Set(CComPtr<IPartDoc>, CComPtr<IEdge>, std::string &, bool overwrite_option=false);
611 bool CAD4FE_COMMON_ITEM SW_EdgeName_Set(CComPtr<IPartDoc>, CComPtr<IEdge>, char *, bool overwrite_option=false);
612 
613 bool CAD4FE_COMMON_ITEM SW_EdgeName_Get(CComPtr<IPartDoc>, CComPtr<IEdge>, std::string &);
614 bool CAD4FE_COMMON_ITEM SW_EdgeName_Get(CComPtr<IPartDoc>, CComPtr<IEdge>, char **);
615 bool CAD4FE_COMMON_ITEM SW_EdgeName_Get(CComPtr<IPartDoc>, CComPtr<IEdge>, const char *);
616 
617 bool CAD4FE_COMMON_ITEM SW_EdgeName_Delete(CComPtr<IPartDoc> __swPart, CComPtr<IEdge> __swEdge);
618 
619 std::string CAD4FE_COMMON_ITEM Convert_VertexToString(CComPtr<IVertex> __swVertex);
620 bool CAD4FE_COMMON_ITEM SW_VertexName_Set(CComPtr<IPartDoc>, CComPtr<IVertex>, std::string &, bool overwrite_option=false);
621 bool CAD4FE_COMMON_ITEM SW_VertexName_Set(CComPtr<IPartDoc>, CComPtr<IVertex>, char *, bool overwrite_option=false);
622 
623 bool CAD4FE_COMMON_ITEM SW_VertexName_Get(CComPtr<IPartDoc>, CComPtr<IVertex>, std::string &);
624 bool CAD4FE_COMMON_ITEM SW_VertexName_Get(CComPtr<IPartDoc>, CComPtr<IVertex>, char **);
625 
626 bool CAD4FE_COMMON_ITEM SW_EntityName_Delete(CComPtr<IPartDoc>, CComPtr<Sldworks_tlb::IEntity>);
627 bool CAD4FE_COMMON_ITEM SW_EntityName_Set(CComPtr<IPartDoc>, CComPtr<Sldworks_tlb::IEntity> __swEntity, BSTR & __bstrName, bool overwrite=false);
628 bool CAD4FE_COMMON_ITEM SW_EntityName_Get(CComPtr<IPartDoc>, CComPtr<Sldworks_tlb::IEntity> __swEntity, BSTR & __bstrName);
629 
630 
631 #endif
632 
633 
634 
void V(MCAA *mcaa)
CAD4FE_COMMON_ITEM bool SW_Edge_NameById(CComPtr< IModelDoc2 > __swModel, CComPtr< IEdge > __swEdge, int &__id, bool &name_existed_before)
CAD4FE_COMMON_ITEM int SW_Face_IsRevolved(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM void SW_Face_Evaluate0(CComPtr< IFace2 > __swFace, double uv[2], double __result[3])
CAD4FE_COMMON_ITEM void SW_Face_GetClosestPointOn(CComPtr< IFace2 > __swFace, double __point[3], double __result[3])
bool CAD4FE_COMMON_ITEM SW_FaceName_Get(CComPtr< IPartDoc > __swPart, CComPtr< IFace2 >, std::string &)
CAD4FE_COMMON_ITEM void SW_Sketch_GetModelCoordinateInSketchSpace(CComPtr< ISketch > __sketch, double __pos_3D[3], double __pos_sketch[3])
CAD4FE_COMMON_ITEM void SW_CoCreateInstance(CComPtr< ISldWorks > &__swApp)
CAD4FE_COMMON_ITEM double * swEdgeGetTessPts(CComPtr< IEdge > &__swEdge, int *__size, double nChordTol=0.000001, double nLengthTol=0.000001)
CAD4FE_COMMON_ITEM void SW_Model_SetAddToDB(CComPtr< IModelDoc2 > __swModel, bool __status)
CAD4FE_COMMON_ITEM int SW_Feature_Suppress(CComPtr< IModelDoc2 > &__swModel, CComPtr< IFeature > &__swFeature)
CAD4FE_COMMON_ITEM int SW_GetSelecteEdgeId(CComPtr< ISldWorks > __swApp)
CAD4FE_COMMON_ITEM CComPtr< T > & SW_Model_GetFirstSelected(CComPtr< IModelDoc2 > __swModel, long __mark)
CAD4FE_COMMON_ITEM void SW_Model_InsertSplitLine(CComPtr< IModelDoc2 > __swModel, CComPtr< ISketch > __swSketch, CComPtr< IFace2 > __swFace, std::map< int, CComPtr< IFace2 > > &__resultFaces)
CAD4FE_COMMON_ITEM int SW_Edge_Evaluate(CComPtr< IEdge > edge, double U, double point[3], double tangent[3])
CAD4FE_COMMON_ITEM int SW_Face_GetMaterialProperties(CComPtr< IFace2 > &swFace, std::vector< double > &)
CAD4FE_COMMON_ITEM CComPtr< IBody2 > & SW_Part_GetBody(CComPtr< IPartDoc > __swPart, int __index, swBodyType_e __swBodyType, bool __onlyVisibleBodies=true)
CAD4FE_COMMON_ITEM void SW_Edge_Tessellate(CComPtr< IEdge > &__swEdge, double __startPnt[3], double __endPnt[3], std::vector< double > &__result)
CAD4FE_COMMON_ITEM void SW_EvaluateClosestPointOnSurface(CComPtr< ISurface > __swSurface, double __pos[3], double __facePos[3], double __uvParams[2])
CAD4FE_COMMON_ITEM void SW_GetActiveDoc(const CComPtr< ISldWorks > &__swApp, CComPtr< IModelDoc2 > &__swModel)
CAD4FE_COMMON_ITEM void SW_Feature_GetProjectionPlane2(CComPtr< IFeature > __swFeature, CComPtr< IModelDoc2 > __swModel, double planeRootPoint[3], double planeNormal[3])
CAD4FE_COMMON_ITEM std::multimap< int, CComPtr< IEdge > > SW_GetItemEdges(LPUNKNOWN punk_item)
CAD4FE_COMMON_ITEM void SW_Model_CreateRefPlane(CComPtr< IModelDoc2 > __swModel, double __rootPoint[3], double __normal[3], CComPtr< IRefPlane > &__swRefPlane)
CAD4FE_COMMON_ITEM void SW_Body_MaxEdgeId(CComPtr< IBody2 > __swBody, int *__id)
CAD4FE_COMMON_ITEM void SW_Edge_SetId(CComPtr< IEdge > __swEdge, int id)
CAD4FE_COMMON_ITEM int SW_Surface_Evaluate3(CComPtr< ISurface > surface, double U, double V, double evaluatedPoint[3], double DerU[3], double DerV[3], double DerUV[3], double DerUU[3], double DerVV[3], double normal[3], int *numUDerivs, int *numVDerivs, long surfIdentity=-516)
CAD4FE_COMMON_ITEM int SW_Curve_Evaluate(CComPtr< ICurve > curve, double U, double point[3], double tangent[3])
bool CAD4FE_COMMON_ITEM SW_EdgeName_Get(CComPtr< IPartDoc >, CComPtr< IEdge >, std::string &)
void CAD4FE_COMMON_ITEM SW_GetEdgeFaces(CComPtr< IEdge > __swEdge, CComPtr< IFace2 > &__swFace1, CComPtr< IFace2 > &__swFace2)
CAD4FE_COMMON_ITEM void SW_ExitApp(CComPtr< ISldWorks > &__swApp)
CAD4FE_COMMON_ITEM void SW_RibFeature_GetDefinition(CComPtr< IFeature > __swFeature, CComPtr< IRibFeatureData2 > &__swFeatData)
CAD4FE_COMMON_ITEM double SW_SimpleFilletFeatureData_GetRadiusAtItem(CComPtr< ISimpleFilletFeatureData2 > __swFeatData, LPUNKNOWN __item)
CAD4FE_COMMON_ITEM bool SW_Face_IsVPeriodic(CComPtr< IFace2 > face)
CAD4FE_COMMON_ITEM int SW_Edge_GetParameters(CComPtr< IEdge > __swEdge, double *__startUParam, double *__endUParam, double *__startPt, double *__endPt, double *__startTanDir, double *__endTanDir, int *_curveType, int *_senseFlag)
CAD4FE_COMMON_ITEM void SW_SketchSegment_GetTessPts(CComPtr< ISketchSegment > &__swSketchSegment, double *__tessPts, int *__size, double nChordTol=.001, double nLengthTol=.001)
CAD4FE_COMMON_ITEM void SW_Edge_GetTangentEdgesPropagation2(CComPtr< IEdge > __swEdge, std::multimap< int, CComPtr< IEdge > > &__tangentEdges, int &__maxEdgeId)
CAD4FE_COMMON_ITEM void SW_Face_EvaluateAtPoint(CComPtr< IFace2 > __swFace, double __pos[3], double *__faceNormal, double *__firstPrincipalDirection=NULL, double *__secondPrincipalDirection=NULL, double *__firstPrincipalCurvature=NULL, double *__secondPrincipalCurvature=NULL)
CAD4FE_COMMON_ITEM int SW_CoEdge_GetFaceInteriorDirection(CComPtr< IEdge > __swEdge, CComPtr< IFace2 > __swFace, double __X[3], double __D[3])
CAD4FE_COMMON_ITEM void SW_ModelView_GetTranslation(CComPtr< IModelView > __swModelView, double __result[3])
CAD4FE_COMMON_ITEM int SW_Face_GetUVBounds(CComPtr< IFace2 > face, double *bbox)
CAD4FE_COMMON_ITEM long SW_Curve_GetIdentity(CComPtr< ICurve > __swCurve)
CAD4FE_COMMON_ITEM int SW_Edge_Evaluate_CheckDomain(CComPtr< IEdge > edge, double U, double point[3], double tangent[3])
CAD4FE_COMMON_ITEM int SW_Sketch_Select(CComPtr< ISketch > __swSketch, CComPtr< ISelectData > __swSelData)
CAD4FE_COMMON_ITEM int SW_Model_RayIntr_GetFirstFaceIntr(CComPtr< IModelDoc2 > __swModel, double __basePointIn[3], double __baseDirectionIn[3], CComPtr< IFace2 > &__swFace, double __intrPoint[3], double __intrPointNorm[3])
CAD4FE_COMMON_ITEM void SW_Part_FindEdgeById(CComPtr< IPartDoc > __swPart, int __id, CComPtr< IEdge > &__swEdge)
CAD4FE_COMMON_ITEM bool SW_Curve_IsLine(CComPtr< ICurve > __swCurve)
CAD4FE_COMMON_ITEM void SW_GetEdgeBounds(CComPtr< IEdge > __swEdge, double *__startParam, double *__endParam)
CAD4FE_COMMON_ITEM int SW_SimpleFilletFeatureData_GetItemsCount(CComPtr< ISimpleFilletFeatureData2 > __swFeatData)
int CAD4FE_COMMON_ITEM Convert_FaceNameToId(std::string)
void SW_Face_CreateTangentPlaneAtCenter(CComPtr< IModelDoc2 > __swModel, CComPtr< IFace2 > __swFace, double __rootPoint[3], double __XVector[3], double __normal[3], CComPtr< IRefPlane > &__swRefPlane)
CAD4FE_COMMON_ITEM int SW_SketchSegment_Select(CComPtr< ISketchSegment > __swSketchSegment, CComPtr< ISelectData > __swSelData)
CAD4FE_COMMON_ITEM int SW_SketchPoint_Select(CComPtr< ISketchPoint > __swSketchPoint, CComPtr< ISelectData > __swSelData)
CAD4FE_COMMON_ITEM int SW_Vertex_GetId(const CComPtr< IVertex > &__swVertex)
CAD4FE_COMMON_ITEM void SW_RefPlane_GetParams(CComPtr< IRefPlane > __swRefPlane, double __origin[3], double __normal[3], double __XVector[3])
CAD4FE_COMMON_ITEM void SW_Edge_GetBody(CComPtr< IEdge > __swEdge, CComPtr< IBody2 > &__swBody)
CAD4FE_COMMON_ITEM int SW_FaceEdge_ReverseEvaluate(CComPtr< IEdge > edge, CComPtr< IFace2 > face, double U, double UV[2])
void CAD4FE_COMMON_ITEM SW_Surface_Parameterization(CComPtr< ISurface > __swSurface, double __uRange[2], double __vRange[2], int __uBoundType[2], int __vBoundType[2], int __uProps[4], int __vProps[4], int __numProps[2])
CAD4FE_COMMON_ITEM std::multimap< int, CComPtr< IEdge > > SW_Loop_GetEdges(CComPtr< ILoop2 > __swLoop)
CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_GetItemAtIndex(CComPtr< ISimpleFilletFeatureData2 > __swFeatData, int __index, LPUNKNOWN &__item)
CAD4FE_COMMON_ITEM void SW_Model_AddConfiguration(CComPtr< IModelDoc2 > &__swModel, std::string __strname, CComPtr< IConfiguration > &__result)
bool CAD4FE_COMMON_ITEM SW_EntityName_Get(CComPtr< IPartDoc >, CComPtr< Sldworks_tlb::IEntity > __swEntity, BSTR &__bstrName)
CAD4FE_COMMON_ITEM bool SW_Face_IsCylinder(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM bool SW_SelectedFaceProperties(CComPtr< IModelDoc2 > __swModel, CComPtr< IFace2 > __swFace, char *&__retName, bool &name_existed_before)
CAD4FE_COMMON_ITEM bool SW_Face_IsUPeriodic(CComPtr< IFace2 > face)
CAD4FE_COMMON_ITEM int SW_Feature_Select(CComPtr< IFeature > __swFeature, CComPtr< ISelectData > __swSelData)
CAD4FE_COMMON_ITEM void SW_FindCommonVertexBetweenTwoAdjacentEdges(CComPtr< IEdge > __swEdge1, CComPtr< IEdge > __swEdge2, CComPtr< IVertex > &__swVertex)
CAD4FE_COMMON_ITEM void SW_Model_SaveToFile(CComPtr< IModelDoc2 > __swModel, const char *__filename)
void SW_Select_and_Mark(CComPtr< T > __swT, bool __append, long __mark)
CAD4FE_COMMON_ITEM void SW_Body_GetBodyBox(CComPtr< IBody2 > __swBody, double __bbox[6])
CAD4FE_COMMON_ITEM void SW_Feature_GetPoint(CComPtr< IFeature > &pFeature, double xyzFeature[3])
CAD4FE_COMMON_ITEM bool SW_Surface_IsSphere(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM int SW_Face_GetId(CComPtr< IFace2 > __swFace)
bool CAD4FE_COMMON_ITEM SW_EntityName_Delete(CComPtr< IPartDoc >, CComPtr< Sldworks_tlb::IEntity >)
CAD4FE_COMMON_ITEM void SW_Model_GetActiveCameraPosition(CComPtr< IModelDoc2 > __swModel, double __result[3])
CAD4FE_COMMON_ITEM void SW_Face_GetBox(CComPtr< IFace2 > __swFace, double __bbox[6])
CAD4FE_COMMON_ITEM int SW_FaceEdge_UVBox(CComPtr< IEdge > edge, CComPtr< IFace2 > face, double startUV[2], double endUV[2])
CAD4FE_COMMON_ITEM double SW_Edge_GetLength(CComPtr< IEdge > __swEdge)
CAD4FE_COMMON_ITEM void SW_GetActiveView(CComPtr< IModelDoc2 > __swModel, CComPtr< IModelView > &__swModelView)
CAD4FE_COMMON_ITEM bool SW_Curve_IsBspline(CComPtr< ICurve > __swCurve)
CAD4FE_COMMON_ITEM int SW_Edge_Select(CComPtr< IEdge > __swEdge, CComPtr< ISelectData > __swSelData)
void SW_Edge_GetClosestPointOn(CComPtr< IEdge > __swEdge, double __point[3], double __result[3])
CAD4FE_COMMON_ITEM void SW_Face_GetTessTriangles(CComPtr< IFace2 > __swFace, long *__triangleCount, SafeDoubleArray **)
CAD4FE_COMMON_ITEM double SW_SimpleFilletFeatureData_GetRadius(CComPtr< ISimpleFilletFeatureData2 > __swFeatData)
CAD4FE_COMMON_ITEM bool SW_Surface_IsTorus(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM bool SW_Face_IsPlane(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM bool SW_Feature_IsSuppressed(CComPtr< IModelDoc2 > &__swModel, CComPtr< IFeature > &__swFeature)
CAD4FE_COMMON_ITEM void SW_App_CreateBoundaryConditionAttributeDef(CComPtr< ISldWorks > &__swApp, CComPtr< IAttributeDef > &DefAttrConditionLimite)
CAD4FE_COMMON_ITEM void SW_MathPoint_GetCoordinates(CComPtr< IMathPoint > __swMathPoint, double __pos[3])
CAD4FE_COMMON_ITEM void SW_ChamferFeatureData_GetAngleDistance(CComPtr< IChamferFeatureData2 > &swFeatData, double *angle, double *distance)
bool CAD4FE_COMMON_ITEM SW_EdgeName_Delete(CComPtr< IPartDoc > __swPart, CComPtr< IEdge > __swEdge)
void SW_Face_GetProjectionPlane(CComPtr< IFace2 > selectedFace1, double __rootPoint[3], double __normal[3])
CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_ReleaseSelectionAccess(CComPtr< ISimpleFilletFeatureData2 > __swFeatData)
CAD4FE_COMMON_ITEM void SW_SimpleFilletFeature_GetDefinition(CComPtr< IFeature > __swFeature, CComPtr< ISimpleFilletFeatureData2 > &__swFeatData)
CAD4FE_COMMON_ITEM int SW_Surface_Evaluate1(CComPtr< ISurface > surface, double U, double V, double point[3], double DU[3], double DV[3], double normal[3])
CAD4FE_COMMON_ITEM bool SW_Curve_IsCircle(CComPtr< ICurve > __swCurve)
CAD4FE_COMMON_ITEM bool SW_Face_IsCone(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM void SW_ChamferFeature_GetDefinition(CComPtr< IFeature > __swFeature, CComPtr< IChamferFeatureData2 > &__swFeatData)
CAD4FE_COMMON_ITEM int SW_Surface_Evaluate2(CComPtr< ISurface > surface, double U, double V, double evaluatedPoint[3], double DerU[3], double DerV[3], double DerUV[3], double DerUU[3], double DerVV[3], double normal[3], int *numUDerivs, int *numVDerivs, long *surfIdentity)
CAD4FE_COMMON_ITEM CComPtr< T > & SW_Model_GetSelected(CComPtr< IModelDoc2 > __swModel, long __nth, long __mark)
bool CAD4FE_COMMON_ITEM SW_EdgeName_Set(CComPtr< IPartDoc >, CComPtr< IEdge >, std::string &, bool overwrite_option=false)
CAD4FE_COMMON_ITEM bool SW_SelectedEdgeProperties(CComPtr< IModelDoc2 > __swModel, CComPtr< IEdge > __swEdge, std::string &__retName, bool &name_existed_before)
CAD4FE_COMMON_ITEM bool SW_Face_IsSphere(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM int SW_OpenDoc(const CComPtr< ISldWorks > &__swApp, char *filename, CComPtr< IModelDoc2 > &__swModel, char __configuration[]="")
void SW_RefPoint_GetPoint(CComPtr< IRefPoint > __swRefPoint, double __result[3])
CAD4FE_COMMON_ITEM void SW_Part_FindFaceById(CComPtr< IPartDoc > __swPart, int __id, CComPtr< IFace2 > &__swFace)
CAD4FE_COMMON_ITEM void SW_Edge_EvaluateCurvilinearDistancePoint(CComPtr< IEdge > __swEdge, CComPtr< IVertex > __swVertex, double __L, double *__LResult, double *__t, double __X[3])
CAD4FE_COMMON_ITEM bool SW_Surface_IsPlane(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM bool SW_Face_IsSwept(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM int SW_Feature_TestAttribute(CComPtr< IFeature > &__swFeature, CComPtr< IAttributeDef > &)
CAD4FE_COMMON_ITEM bool SW_Surface_IsSwept(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM int SW_Face_ReverseEvaluate0(CComPtr< IFace2 > __swFace, double __pos[3], double __uv[2])
CAD4FE_COMMON_ITEM int SW_Face_Select(CComPtr< IFace2 > __swFace, CComPtr< ISelectData > __swSelData)
CAD4FE_COMMON_ITEM void SW_Edge_ReverseEvaluate(CComPtr< IEdge > __swEdge, double __pos[3], double *__u, double __tanDir[3])
CAD4FE_COMMON_ITEM bool SW_Surface_IsCylinder(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM bool SW_Face_IsTorus(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM DWORD WINAPI SW_App_SendMsgToUser_Ok(void *pointerSW)
bool CAD4FE_COMMON_ITEM SW_VertexName_Set(CComPtr< IPartDoc >, CComPtr< IVertex >, std::string &, bool overwrite_option=false)
double SW_Edge_GetDistanceToPoint(CComPtr< IEdge > __swEdge, double __point[3])
CAD4FE_COMMON_ITEM int SW_Edge_TestAttribute(CComPtr< IEdge > &__swEdge, CComPtr< IAttributeDef > &)
CAD4FE_COMMON_ITEM void SW_Sketch_Select_and_Mark(CComPtr< ISketch > __sketch, bool __append, long __mark)
CAD4FE_COMMON_ITEM void SW_Feature_GetBoundingBox(CComPtr< IModelDoc2 > &__swModel, CComPtr< IFeature > &__swFeature, double __bbox[6])
CAD4FE_COMMON_ITEM bool SW_Face_NameById(CComPtr< IModelDoc2 > __swModel, CComPtr< IFace2 > __swFace, int &__id, bool &name_existed_before)
bool CAD4FE_COMMON_ITEM SW_EntityName_Set(CComPtr< IPartDoc >, CComPtr< Sldworks_tlb::IEntity > __swEntity, BSTR &__bstrName, bool overwrite=false)
bool CAD4FE_COMMON_ITEM SW_FaceName_Set(CComPtr< IPartDoc > __swPart, CComPtr< IFace2 >, std::string &, bool overwrite_option=false)
CAD4FE_COMMON_ITEM void SW_Edge_EvaluateAtVertex(CComPtr< IEdge > __swEdge, CComPtr< IVertex > __swVertex, double __point[3], double __tangent[3])
CAD4FE_COMMON_ITEM void SW_Feature_GetProjectionPlane(CComPtr< IFeature > swFeature, double planeRootPoint[3], double planeNormal[3])
CAD4FE_COMMON_ITEM CComPtr< IPartDoc > & SW_Model_GetPart(CComPtr< IModelDoc2 > __swModel)
CAD4FE_COMMON_ITEM bool SW_Face_GetMaterialPropertyValues2(CComPtr< IFace2 > __swFace, double *R, double *G, double *B, double *ambient, double *diffuse, double *specular, double *shininess, double *transparency, double *emission)
CAD4FE_COMMON_ITEM int SW_Part_GetBodiesCount(CComPtr< IPartDoc > __swPart, swBodyType_e __swBodyType, bool __onlyVisibleBodies=true)
CAD4FE_COMMON_ITEM void SW_Face_GetBoxTessellation(CComPtr< IFace2 > &__swFace, double __bbox[6])
CAD4FE_COMMON_ITEM void SW_CloseDoc(CComPtr< IModelDoc2 > &__swModel)
CAD4FE_COMMON_ITEM void SW_Model_GetActiveViewTranslation(CComPtr< IModelDoc2 > __swModel, double __result[3])
CAD4FE_COMMON_ITEM int SW_Face_TestAttribute(CComPtr< IFace2 > &__swFace, CComPtr< IAttributeDef > &)
CAD4FE_COMMON_ITEM int SW_Vertex_TestAttribute(CComPtr< IVertex > &__swVertex, CComPtr< IAttributeDef > &)
CAD4FE_COMMON_ITEM void SW_Face_RandomCreatePoint(CComPtr< IFace2 > __swFace, double __uvBounds[4], double __result[3])
CAD4FE_COMMON_ITEM std::multimap< int, CComPtr< IEdge > > SW_Face_GetEdges(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM void SW_MathVector_ConvertToPoint(CComPtr< IMathVector > __swMathVector, CComPtr< IMathPoint > &__swMathPoint)
int CAD4FE_COMMON_ITEM Convert_EdgeNameToId(std::string)
CAD4FE_COMMON_ITEM void SW_Feature_GetDefinition(CComPtr< IFeature > __swFeature, CComPtr< T > &__swFeatData)
CAD4FE_COMMON_ITEM bool SW_Surface_IsCone(CComPtr< ISurface > __swSurface)
CAD4FE_COMMON_ITEM bool SW_Model_SuppressConfiguration(CComPtr< IModelDoc2 > &__swModel, std::string __name)
CAD4FE_COMMON_ITEM void SW_Part_InitIDs(CComPtr< IPartDoc > __swPart)
CAD4FE_COMMON_ITEM int SW_Edge_GetId(CComPtr< IEdge > __swEdge)
CAD4FE_COMMON_ITEM void SW_Face_Select_and_Mark(CComPtr< IFace2 > __swFace, bool __append, long __mark)
bool CAD4FE_COMMON_ITEM SW_VertexName_Get(CComPtr< IPartDoc >, CComPtr< IVertex >, std::string &)
CAD4FE_COMMON_ITEM void SW_EvaluateClosestPointOnFace(CComPtr< IFace2 > __swFace, double __pos[3], double *__facePos, double *__uParams, double *__vParams)
std::string CAD4FE_COMMON_ITEM Convert_VertexToString(CComPtr< IVertex > __swVertex)
CAD4FE_COMMON_ITEM void SW_Face_ClosetPointOnContour(CComPtr< IFace2 > __swFace, double __point[3], double __result[3])
CAD4FE_COMMON_ITEM void SW_SimpleFilletFeatureData_AccessSelections(CComPtr< ISimpleFilletFeatureData2 > __swFeatData, CComPtr< IModelDoc2 > __swModel)
CAD4FE_COMMON_ITEM void SW_Vertex_GetPoint(CComPtr< IVertex > __swVertex, double __pnt[3])
CAD4FE_COMMON_ITEM void SW_Face_GetCenterPoint(CComPtr< IFace2 > __swFace, CComPtr< IModelDoc2 > __swModel, double __result[3])
CAD4FE_COMMON_ITEM long SW_Face_GetLoopCount(CComPtr< IFace2 > __swFace)
CAD4FE_COMMON_ITEM void SW_Sketch_GetPlaneParams(CComPtr< ISketch > &__swSketch, double __origin[3], double __normal[3], double __XVector[3])
CAD4FE_COMMON_ITEM void SW_Model_CreateLineInSketch(CComPtr< IModelDoc2 > __swModel, CComPtr< ISketch > __swSketch, double __P0[3], double __P1[3])