AutoCAD对象模型及属性方法
Application应用程序
Preferences
Documents图形文档集合
Document图形文档对象
方法Class Name :AcadDocument
Activate活动
AuditInfo检查图纸完整性
Close关闭文档
CopyObjects复制多个对象(深度克隆)。
EndUndoMark标记操作块的结束
Export导出
GetVariable获取AutoCAD系统变量的当前设置
HandleToObject获取与给定句柄对应的对象
Import导入
LoadShapeFile加载形状文件
This method makes all the shapes in the shape file available to the current drawing. To add a shape into the drawing, use the AddShape method.
New在SDI模式下创建新文档
Dim templateFileName As StringtemplateFileName = "c:\AutoCAD\template\ansi-a.dwt"If AcadApplication.preferences.System.SingleDocumentMode = True ThenThisDrawing.New templateFileNameElseThisDrawing.Application.Documents.Add templateFileNameEnd If
ObjectIDToObject获取与给定对象ID对应的对象
Open打开现有图形文件(DWG)并使其成为活动文档
PostCommand发送命令字符串(异步执行)
PurgeAll从文档中删除未使用的命名引用
Regen重新生成整个图形,并重新计算所有对象的屏幕坐标和视图分辨率
Save保存
SaveAs另存为
SendCommand将命令字符串从VB或VBA应用程序发送到文档进行处理(同步执行)
SetVariable设置cad系统变量
StartUndoMark标记操作`块的开始
WBlock写块
属性 Active活动的(bool)ActiveDimStyle指定激活的标注样式ActiveLayer指定活动图层ActiveLayout活动布局ActiveLinetype指定图形的活动线型ActiveMaterial指定此文档的当前默认材质ActivePViewport指定图形的活动图纸空间视口ActiveSelectionSet获取图形的活动选择集ActiveSpace在图纸空间和模型空间之间切换活动空间ActiveTextStyle指定图形的激活文字样式ActiveUCS指定图形的活动UCSActiveViewport指定图形的活动视口Application程序Blocks获取图形的块集合Database获取对象所属的数据库Dictionaries获取文档的字典集合DimStylesElevationModelSpace指定模型空间中的高设置(z轴)ElevationPaperSpace指定图纸空间中的高设置(z轴)FullName获取应用程序或文档的名称,包括路径Groups获取文档的组集合Height更改对象的高度HWND窗口框架句柄Layers获取文档层集合Layouts获取文档布局集合Limits指定图形限制
Linetypes获取文档的线型集合Materials返回数据库的材质集合ModelSpace获取文档的ModelSpace集合MSpace允许从浮动图纸空间视口编辑模型Name指定对象的名字ObjectSnapMode指定对象捕捉模式的设置PaperSpace获取文档的PaperSpace集合Path获取路径PickfirstSelectionSet获取第一个选择集Plot获取文档的打印对象PlotConfigurations获取文档的PlotConfigurations集合Preferences获取首选项对象ReadOnly指定文档或属性是只读还是读写RegisteredApplications获取文档的RegisteredApplications集合Saved指定文档是否有任何未保存的更改(bool)SectionManager返回节管理器对象SelectionSets获取文档的SelectionSets集合SummaryInfo指定图形的特性TextStyles获取文档的TextStyles集合UserCoordinateSystems获取文档的UCS集合Utility获取文档的实用程序对象Viewports获取文档的视口集合Views获取文档的视图集合Width指定对象宽度WindowState指定应用程序或文档窗口的状态限制图形X,Y坐标系。左下和右上
he drawing limits are two-dimensional points in the World Coordinate System (WCS) that represent a lower-left and an upper-right limit. You cannot impose limits on the Z direction.
注意:The lower-left limit controls the LIMMIN system variable. The upper-right limit controls the LIMMAX system variable. The LIMCHECK system variable turns limits checking on and off for the current space.
WindowTitle文档窗口标题Type: acWindowState enum
acMin: The window is minimized.
acMax: The window is maximized.
acNorm: The window is normal (neither minimized nor maximized).
Blocks图形中所有块的集合
方法Class Name:AcadBlocks
Add创建成员对象并将其添加到相应的集合中
InsertionPoint
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying where the Blocks object will be added.
Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "New_Block")
GetExtensionDictionary获取与对象关联的扩展字典
GetXData获取与对象关联的扩展数据
Item成员队列
SetXData设置与对象关联的扩展数据
属性 Applicationcad应用程序Count成员个数Document对象所属的文档Handle对象句柄HasExtensionDictionary确定对象是否有与其关联的扩展字典ObjectID对象IDObjectName对象的AutoCAD类名OwnerID所有者(父)对象的对象ID
Block包含名称和一组对象的块定义
方法 Add3DFace在给定四个顶点的情况下创建3DFace对象Class Name:AcadBlock
Add3DMeshAdd3DPolyAddArcAddAttributeAddBoxAddCircleAddConeAddCustomObjectAddCylinderAddDim3PointAngularAddDimAlignedAddDimAngularAddDimArcAddDimDiametricAddDimOrdinateAddDimRadialAddDimRadialLargeAddDimRotatedAddEllipseAddEllipticalConeAddEllipticalCylinderAddExtrudedSolidAddExtrudedSolidALongPathAddHatchAddLeaderAddLightWeightPolylineAddLineAddMInsertBlockAddMLeaderAddMLineAddMTextAddPointAddPolyfaceMeshAddPolylineAddRasterAddRayAddRegionAddRevolvedSolidAddSectionAddShapeAddSolidAddSphereAddSplineAddTableAddTextAddToleranceAddTorusAddTraceAddWedgeAddXLineAttachExternalReference将外部参照(xref)附着到图形Bind将外部参照(xref)绑定到图形Delete删除指定的对象Detach从图形中拆离外部参照GetExtensionDictionary获取与对象关联的扩展字典GetXData获取与对象关联的扩展数据InsertBlock插入已在当前图形中定义的图形文件或命名块Item成员队列Reload重新加载外部参照SetXData设置与对象关联的扩展数据Unload卸载属性 ApplicationBlockScaling指定块允许的缩放比例Comments块注释Count成员个数Document获取对象所属的文档Explodable指定是否可以分解块boolHandle句柄HasExtensionDictionary确定对象是否有与其关联的扩展字典IsDynamicBlock是否动态块IsLayout是否为布局块IsXRef是否为外部参照块Layout块对象关联的布局Material材质的名称Name名称ObjectID对象IDObjectName对象的AutoCAD类名Origin插入的原点OwnerIDPathUnits块的本机度量单位XRefDatabase获取定义块内容的数据库对象
RetVal = object.Add3DFace(Point1, Point2, Point3 [, Point4])
ModelSpace包含所有模型空间图元的特殊块对象
方法 Add3DFaceAdd3DMeshAdd3DPolyAddArcAddAttributeAddBoxAddCircleAddConeAddCustomObjectAddCylinderAddDim3PointAngularAddDimAlignedAddDimAngularAddDimArcAddDimDiametricAddDimOrdinateAddDimRadialAddDimRadialLargeAddDimRotatedAddEllipseAddEllipticalConeAddEllipticalCylinderAddExtrudedSolidAddExtrudedSolidALongPathAddHatchAddLeaderAddLightWeightPolylineAddLineAddMInsertBlockAddMLeaderAddMLineAddMTextAddPointAddPolyfaceMeshAddPolylineAddRasterAddRayAddRegionAddRevolvedSolidAddSectionAddShapeAddSolidAddSphereAddSplineAddTableAddTextAddToleranceAddTorusAddTraceAddWedgeAddXLineAttachExternalReferenceGetExtensionDictionaryGetXdataInsertBlockItemSetXdata 属性 ApplicationCommentsCountDocumentHandleHasExtensionDictionaryLayoutNameObjectIDObjectNameOriginOwnerIDUnitsClass Name:AcadModelSpace
Document.ModelSpace
PaperSpace包含激活图纸空间布局中所有图元的特殊块对象
方法 Add3DFaceAdd3DMeshAdd3DPolyAddArcAddAttributeAddBoxAddCircleAddConeAddCustomObjectAddCylinderAddDim3PointAngularAddDimAlignedAddDimAngularAddDimArcAddDimDiametricAddDimOrdinateAddDimRadialAddDimRadialLargeAddDimRotatedAddEllipseAddEllipticalConeAddEllipticalCylinderAddExtrudedSolidAddExtrudedSolidALongPathAddHatchAddLeaderAddLightWeightPolylineAddLineAddMInsertBlockAddMLeaderAddMLineAddMTextAddPointAddPolyfaceMeshAddPolylineAddPViewportAddRasterAddRayAddRegionAddRevolvedSolidAddSectionAddShapeAddSolidAddSphereAddSplineAddTableAddTextAddToleranceAddTorusAddTraceAddWedgeAddXLineAttachExternalReferenceGetExtensionDictionaryGetXdataInsertBlockItemSetXdata 属性 ApplicationCountDocumentHandleHasExtensionDictionaryLayoutNameObjectIDObjectNameOwnerIDClass Name:AcadPaperSpace