几何尺寸与公差论坛

 找回密码
 注册
查看: 2223|回复: 9

我把文档中SelectByID的说明翻译了一遍,大家看对不对

[复制链接]
发表于 2009-1-6 15:54:08 | 显示全部楼层 |阅读模式
我将文档中这个函数的解释翻译了一遍,如下
status = ModelDocExtension->SelectByID2 ( Name, Type, X, Y, Z, Append, Mark, Callout, SelectOption, retval )

AppendTRUE时,如果实体已经被选择了那么这个实体将从当前的选择列表中移除,如果实体没有被选择那么这个实体将附加到当前的选择列表中;

AppendFASLE时,如果实体已经被选择了那么当前的选择将保留在选择列表中,如果实体没有被选择那么先把当前的选择列表被清除,接着将该实体附加到选择列表中;

Mark:这个值是用来做标记的,它可以被其他需要顺序选择的函数使用;

Callout:指向相关callout的指针;

SW允许插件程序操作单行或多行的编号;要使用编号,必须用swCalloutHandler接口来实现;

The previously listed objects' selection methods do not work well when a PropertyManager page is open or a command is running. This method, ModelDocExtension::SelectByID2, handles selection correctly whether or not a command is running.

当属性管理器页被打开或者某个命令正在运行的时候,以前的选择列的方法可能不工作;若用SelectByID2,总能得到正确的选择列,不管命令是否正在运行。
If your application already has an object handle (for example, Face2), use the appropriate Select method to select the item directly using its handle.

如果你的应用程序已经有了对象句柄(如,Face2),可用这个句柄的某个select方法去选中某项。
To filter the objects selected by this method, set the Type argument. If no filtering is required, then pass an empty string for this argument.

可以设置需排除的Type类型,如果不需要排除某些类型,应传递空字符串作为参数;

For example, to select an object of type swSelDIMENSIONS, use the string that appears in the comment column, "DIMENSION". The objectType might change based on your current state. For example, to select a sketch point that was created in the active sketch, specify the Type "SKETCHPOINT". However, if you do not have an active sketch, or if the point was created in a sketch other than the active sketch, then specify the Type "EXTSKETCHPOINT".

例如,对swSelDIMENSIONS,可在注解列设置“DIMENSION”。对象类型可能会基于你的当前状态发生改变。
例如,要选择草图点,若该草图点创建在激活的草图上,可选用“SKETCHPOINT”类型,若草图没被激活,或者不是激活草图的点,应选用“EXTSKETCHPOINT”类型;

If a type is specified in Type, then this method returns FALSE if it cannot find the matching object type.


在Type中定义的类型,如果不能找到匹配的对象类型的话,那么这个方法返回FALSE;

The Name argument is not intended for selection of faces, edges, and so on. This is a case-sensitive string for objects that are automatically named by SolidWorks during entity creation, such as dimensions, drawing views, and so on. This method tries to find and select an object whose name matches the Name argument; however, the match needs to be exact for this method to return TRUE.

Name实参在faces,edges等等选择时,可以不设置;它是个对大小写敏感的字符串,在实体创建时,SolidWorks可以自动命名,比如尺寸(dimension),绘图视图(drawing view)等等;这个方法查找并选中和Name相匹配的对象;若完全匹配,返回TRUE;

For example, if a string is passed that matches an object name but whose case does not match exactly, this method might return FALSE. For selection of dimensions, the Name argument needs to be fully qualified. For example, specify "D1@Sketch2@Part1.SLDPRT" rather than simply "D1@Sketch2"; otherwise, this method might return FALSE. If you do not know the object name, or if it is an item that is not automatically named by SolidWorks, you can pass an empty string.

例如,如果字符串和对象名匹配,但是它的大小写不匹配的话,也会返回FALSE;对于尺寸的选择,这个实参需要完全限定,例如,需定义"D1@Sketch2@Part1.SLDPRT" ,而不是简单的定义"D1@Sketch2";否则这个函数可能会返回FALSE。如果你不知道这个对象名,或者这个对象不会由SolidWorks自动命名的话,传递空字符串即可。

If you are using the Name parameter, then specify the XYZ coordinates in terms of the context where the item was created. For example, if you want to select a sketch point using its name (for example, "oint1") in the Name argument, then specify XYZ in terms of the sketch where the point was created. Even if the sketch is not active, specify the XYZ values in terms of sketch space when you use the Name parameter. In certain situations, you can also pass in the XYZ coordinates as simply ( 0,0,0 ). For example, to select a feature shown in the FeatureManager design tree, you do not need to specify an XYZ coordinates. However, to select objects such as notes or faces, or when you need a point location picked, you must specify the XYZ coordinates. If you are not using the Name parameter as a filter, then specify the XYZ coordinates in terms of model space.

如果你正在使用这个Name参数,可以根据要创建的项的上下文来定义XYZ坐标。例如,如果你想用名字(例如Point1)来选择草图点;即使这个草图没有被激活,当你用Name参数时就根据草图空间来定义XYZ坐标;在一定条件下,你可以简单的用(0,0,0)来作为XYZ坐标;例如,如果选择一个在特征管理设计树的特征,你就不用定义XYZ坐标了。然而,为了选择比如note of faces,或者当你需要你点击点的位置,你必须定义XYZ坐标。如果你没有用Name参数作为过滤器,那么就可以根据模型空间来定义XYZ了(绝对坐标系)。

If you do not know the object name or the object type, pass in empty strings for the Name and Type parameters and the selection routine makes the best attempt to select the correct object.

如果你不知道这个对象名或者对象类型,传递空字符串即可,SW会尽可能选中正确的对象。

To get [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/Face2/Face2.htm]Face2[/url], [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/Edge/Edge.htm]Edge[/url] or [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/Vertex/Vertex.htm]Vertex[/url] objects by name, use [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/PartDoc/PartDoc__GetEntityByName.htm]PartDoc::GetEntityByName[/url].

获取face2,Edge,Vertex的对象名,可以用PartDoc::GetEntityByName。

For SelectOption, specify swSelectOptionDefault to indicate that the Shift key is not used during selection or specify swSelectOptionExtensive to indicate that the Shift key is used during selection.

对于选择选项,swSelectOptionDefault表示在选择过程中没有使用Shift键,而swSelectOptionExtensive表示选择过程中使用了Shift键。

The [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/ModelDoc2/ModelDoc2.htm]ModelDoc2[/url] object used to call this method must be an open and visible document. For example, you cannot use the ModelDoc2 object returned from an assembly component ([url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/Component2/Component2__IGetModelDoc.htm]Component2::GetModelDoc[/url]) unless that SolidWorks component part or subassembly is an open and visible document. In this case, you can select the item using the fully-qualified name (for example, "lane4@Part1-1@Assem1").

ModelDoc2对象调用这个函数,必须是这个文档是打开并且是可见的。例如,你不能用ModelDoc2来返回一个装配图component(Compnent2::GetModelDoc),除非SolidWorks的元件零件或子装配体是打开并且是可见的。在这种情况下,用完全限定名称来选择这个项目(例如, "lane4@Part1-1@Assem1")。

When selecting Face2 objects, this method uses the specified point as input to the normal user-interface selection routines to use the speed of ray tracing. As a result, if the view changes from the original recorded size or orientation, then the same Face2 might not be selected next time. If your application has a pointer to the Face2 object to be selected, then you can call the [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/Entity/Entity__Select4.htm]Entity::Select4[/url] method directly. Otherwise, you can call [url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/ModelDoc2/ModelDoc2__SelectByRay.htm]ModelDoc2::SelectByRay[/url]. Calling ModelDoc2::SelectByRay allows for tighter control over the starting point and the direction in which to search.

当选择Face2对象时,这个方法用特定点作为用于光线追踪速度的用户接口选择路径。因此,如果视图从原始记录的大小或方向发生改变,那么同样的Face1对象可能下次就不会被选择成功。如果你的应用程序有指向这个要被选择的Face2对象的指针,那么你就可以直接调用Entity::Sekect4。否则你就调用[url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/ModelDoc2/ModelDoc2__SelectByRay.htm]ModelDoc2::SelectByRay[/url]。调用[url=http://mkMSITStore:C:%20Documents%20and%20Settings%20Weixieming%20桌面%20好资料%20sldworksapi.chm::/ModelDoc2/ModelDoc2__SelectByRay.htm]ModelDoc2::SelectByRay[/url]允许通过用开始点和方向来进行更紧密的寻找。


不知道我翻译的是否准确,大家看看
yogy>进行了部分修改,少许建议,“一个”在英文译中文中,尽量少用;尽量少直译,用中文说清楚意思即可。
 楼主| 发表于 2009-1-6 15:55:14 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

大家可以QQ交流下:286210747
 楼主| 发表于 2009-1-6 15:56:21 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

还有我的博客地址,是我自己关于SW二次开发的一些笔记,大家可以看看
http://hi.baidu.com/wmwmwm171717/blog/


yogy>你的博客背景是红色为主色调,若文章字体为黑色,有点看不清楚哦。
建议:
文章字体改成白色,或背景颜色改成白色。
 楼主| 发表于 2009-1-7 08:30:56 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

大家走过路过,还没看到吗?知道的说说哦,这个问题牵连甚广
 楼主| 发表于 2009-1-13 12:36:30 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

大版主啊,怎么现在还没人给我回信息呢??!
 楼主| 发表于 2009-1-14 15:10:10 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

There is no man to answer my question, that `s because i use the Chinese , mean that i should use English?
 楼主| 发表于 2009-2-6 16:10:42 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

怎么回事啊,版主,我的问题都放了快一个月了都没人发表意见啊

yogy>直接看英文帮助,不行么?为何要翻译成中文?
发表于 2009-2-11 13:09:00 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

若安装SW中文版,api帮助也是英文的?
 楼主| 发表于 2009-2-11 14:24:57 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

是啊,都是英文的,难道你的是中文的???
 楼主| 发表于 2009-2-22 10:25:55 | 显示全部楼层

回复: 我把文档中SelectByID的说明翻译了一遍,大家看对不对

又这么长时间了,还是那么冷清
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 19:10 , Processed in 0.048005 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表