InsertBlock Method (ActiveX)
InsertBlock Method (ActiveX)
转http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-17F86FDD-B7FC-4F43-9F16-B4958F73A66D
Object Model (ActiveX)
Click on a class in the image to open its associated topic.
Related Reference
- Reference Guide (ActiveX)
Inserts a drawing file or a named block that has been defined in the current drawing.
Supported platforms: Windows only
Signature
RetVal = object.InsertBlock(InsertionPoint, Name [, Xscale [, Yscale [, ZScale [, Rotation [, Password]]]]])
Type: Block, ModelSpace, PaperSpace
The objects this method applies to.
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying the location in the drawing toinsert the block.
Name
Access: Input-only
Type: String
The name of the AutoCAD drawing file or the name of the block to insert. If it is a file name, include the .dwg extension and any path information necessary for AutoCAD to find the file.
Xscale
Access: Input-only; optional
Type: Double
The default equals 1.0. Must be a positive number.
Yscale
Access: Input-only; optional
Type: Double
The default equals 1.0. Must be a positive number.
Zscale
Access: Input-only; optional
Type: Double
The default equals 1.0. Must be a positive number.
Rotation
Access: Input-only; optional
Type: Double
The default equals 0.0 radians.
Password
Access: Input-only; optional
Type: Variant
The password that was applied to the drawing file when it was saved.
Return Value (RetVal)
Type: BlockReference
The placed block as a Block Reference object.
Remarks
Inserting a block into another block will create nested blocks.
Attempting to call the InsertBlock method with an uninitialized Name parameter results in unexpected behavior.
Examples
VBA:
Sub Example_InsertBlock()' This example creates a block containing a circle.' It then inserts the block.' Create the blockDim blockObj As AcadBlockDim insertionPnt(0 To 2) As DoubleinsertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")' Add a circle to the blockDim circleObj As AcadCircleDim center(0 To 2) As DoubleDim radius As Doublecenter(0) = 0: center(1) = 0: center(2) = 0radius = 1Set circleObj = blockObj.AddCircle(center, radius)' Insert the blockDim blockRefObj As AcadBlockReferenceinsertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)ZoomAllEnd Sub
Visual LISP:
(vl-load-com)
(defun c:Example_InsertBlock();; This example creates a block containing a circle.;; It then inserts the block.(setq acadObj (vlax-get-acad-object))(setq doc (vla-get-ActiveDocument acadObj));; Create the block(setq insertionPnt (vlax-3d-point 0 0 0))(setq blockObj (vla-Add (vla-get-Blocks doc) insertionPnt "CircleBlock"));; Add a circle to the block(setq center (vlax-3d-point 0 0 0)radius 1)(setq circleObj (vla-AddCircle blockObj center radius));; Insert the block(setq insertionPnt (vlax-3d-point 2 2 0))(setq modelSpace (vla-get-ModelSpace doc))(setq blockRefObj (vla-InsertBlock modelSpace insertionPnt "CircleBlock" 1 1 1 0))(vla-ZoomAll acadObj)
)
-INSERT(命令)
涵盖的产品和版本
作者:
Help
2018 年 7 月 26 日产品内视图
分享
添加到集合
将块或图形插入当前图形中。
将显示以下提示:
块名
指定要插入的块的名称。
注: 插入图形中的编组对象作为未命名编组插入。在 AutoCAD LT 中,可以通过在“对象编组”对话框中选择“未命名编组”列出未命名的编组。在 AutoCAD LT 中,可以通过在编组管理器中选择“包括未命名的编组”列出未命名编组。
输入波浪号 (~) 可显示“选择图形文件”对话框(标准文件选择对话框)。
您可以使用以下方法控制块的插入方式:
- 插入分解块:在块名前加星号 (*) 将分解块并插入块的各个部分。块定义并不添加到图形中。
- 更新块路径:如果输入的块名没有路径名,INSERT 将先按照该名称在当前图形数据中搜索现有块定义。您可以通过输入 block name=file name,将现有块定义替换为外部文件。
- 升级块定义:如果修改插入到图形中的块文件,并希望更改现有块定义而不创建新的块插入,请在“插入点”提示(位于“块名”提示后)下输入以下内容:
块名=
如果在块名后输入 =,则将显示以下提示:
块“当前”已存在。是否重定义?
指定“是”或“否”。
如果选择重新定义块,新的块定义将替换现有块定义。重生成图形,并将新定义应用于块定义的所有现有插入。如果不希望将新块插入到图形中,请在提示输入插入点时按 Esc 键。
?—列出块名称
列出图形中当前定义的块。
插入点
指定块或图形的位置。
比例因子
块或图形的所有 X 和 Y 标注将乘以 X 和 Y 比例因子。块或图形以插入点作为旋转中心按指定角度旋转。
角点
同时以插入点和另一点作为长方体的角点,定义 X 和 Y 的比例因子。长方体的 X 和 Y 标注成为 X 和 Y 的比例因子。插入点是第一角点。
XYZ
设定 X、Y 和 Z 比例因子。
- X 比例因子: 为块或图形定义 X、Y 和 Z 比例因子
- 角点: 同时,使用插入点和另一点作为长方体的角点,定义 X 和 Y 比例,然后定义 Z 比例。
基点
将块临时放置到其当前所在的图形中,并允许在将块参考拖动到位时为其指定新基点。这不会影响为块参照定义的实际基点。
比例
为 X、Y 和 Z 轴设定比例因子。Z 轴比例是指定比例因子的绝对值。
X
设定 X 比例因子。
Y
设定 Y 比例因子。
Z
设定 Z 比例因子。
旋转
设定块插入的旋转角度。
地理
将附着文件的地理位置设定为参照。
相关概念
InsertBlock Method (ActiveX)相关推荐
- Python AutoCAD 块组
目 录 Blog Links 一.连接及库导入 二.块 2.1. 创建新块 2.2. 添加图元到块 2.3. 插入块 2.3.1. 从当前文件中插入块 2.3.2. 外部文件作为块插入 2.4. 添加 ...
- COM组件开发实践(七)---多线程ActiveX控件和自动调整ActiveX控件大小(上)
声明:本文代码基于CodeProject的文章<A Complete ActiveX Web Control Tutorial>修改而来,因此同样遵循Code Project Open L ...
- VC ActiveX 控件 开发总结
VC 制作ActiveX 控件(OCX) http://ileson.iteye.com/blog/1002910 1.vc6下建立一下activeX工程 详见http://hi.baidu. ...
- [转]ASP中ActiveX控件的内嵌及调用
懂ASP(Active Server Pages)的人很多,但能用ASP自如地调用ActiveX控件的人却不多:如果不调用ActiveX控件,则可以说微软当初设计ASP的初衷根本没有达到.众所周知,A ...
- Exposing Windows Forms Controls as ActiveX controls
转:http://www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp?df=100&forumid=2373&exp= ...
- 使用MFC开发ActiveX控件
摘要: 本文对COM组件中的ActiveX控件的MFC开发方法进行了介绍,讲述了用户自定义和库存属性.方法以及事件的添加方法和属性页的制作过程.使读者能够掌握基本的MFC ActiveX开发方法. 前 ...
- activex控件方法和事件
activex控件方法(method):即对象自己调用,比如有一个CGLClock控件, 该控件中定义了方法SetClockAngle(double m_newAngle);//其中代码用于更改表盘指 ...
- word把对应图片变成嵌入的ActiveX控件。
刚做一个小东东,做的过程还是走过些弯路,记录一下,客户提出word报表上的图太单调,提出把对应的报表上的图做成如程序里显示的Chart控件一样,能缩放,能做一些数据的转换运算然后显示.最开始我是准备用 ...
- 将Capicom调用代码封装到ActiveX——解决javascript调Capicom读取数字证书信息时,IE弹出安全提示的问题...
此文系转载 原文:http://www.cnblogs.com/xuezhizhang/archive/2011/07/10/2102542.html 一.使用javascript方法: <ob ...
最新文章
- Docker大行其道—镜像
- 如何用python画一个小房子?
- DL之DeepLabv3:DeepLab v3和DeepLab v3+算法的简介(论文介绍)、架构详解、案例应用等配图集合之详细攻略
- NYOJ 891 找点
- 爱了!爱了!Markdown 必备组合神器!
- css中改变边距会影响原大小,CSS:更改父容器中子项的边距会改变子项的宽度吗?...
- Jsoup代码解读之五-parser(中)
- javafx动画_JavaFX:创建Sprite动画
- 提升应用程序弹性:保障工作负载正常运行
- 关于maven依赖中的scope的作用和用法
- Gentoo rc-update service ‘net.eth0′ does not exist
- HTML5+CSS3设计界面
- 词法分析器的java代码_利用Java实现简单的词法分析器实例代码
- matlab 功率谱密度 汉宁窗_Matlab实例|频谱、功率谱和功率谱密度计算详解
- 华为服务器型号大全rh2288h,华为服务器 RH2288H V3 12*3.5盘位 E5-2680 v4*2 16GB*8 6000G*3 R5 750W*2 4*GE.....
- 启动redis失败 Could not create server TCP listening socket 127.0.0.1:6379: bind: 操作成功
- pandas画柱状图,线形图
- java《面向对象综合题》
- win32编程,将rgb图像绘制到窗口句柄
- SQLI-LABS Page 1 ——Less 04