明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2386|回复: 9

提取blockreference中一个圆的方法

[复制链接]
发表于 2006-5-18 22:47:00 | 显示全部楼层 |阅读模式

假如一个块中有一个圆及两条直线,我现在想得到块中圆的大小,请问用什么方法较好

望大师指点,谢谢

以下是acad帮助,为什么没有item这个属性

Methods MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_arraypolar.htm" target="_blank" >

ArrayPolar MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_arrayrectangular.htm" target="_blank" >

ArrayRectangular MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_copy.htm" target="_blank" >

Copy MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_delete.htm" target="_blank" >

Delete MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_explode.htm" target="_blank" >

Explode MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_getattributes.htm" target="_blank" >

GetAttributes MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_getboundingbox.htm" target="_blank" >

GetBoundingBox MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_getconstantattributes.htm" target="_blank" >

GetConstantAttributes MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_getextensiondictionary.htm" target="_blank" >

GetExtensionDictionary MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_getxdata.htm" target="_blank" >

GetXData MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_highlight.htm" target="_blank" >

Highlight MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_intersectwith.htm" target="_blank" >

IntersectWith MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_mirror.htm" target="_blank" >

Mirror MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_mirror3d.htm" target="_blank" >

Mirror3D MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_move.htm" target="_blank" >

Move MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_rotate.htm" target="_blank" >

Rotate MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_rotate3d.htm" target="_blank" >

Rotate3D MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_scaleentity.htm" target="_blank" >

ScaleEntity MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_setxdata.htm" target="_blank" >

SetXData MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_transformby.htm" target="_blank" >

TransformBy MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_update.htm" target="_blank" >

Update  

Properties MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_application.htm" target="_blank" >

Application MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_document.htm" target="_blank" >

Document MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_hyperlinks.htm" target="_blank" >

Hyperlinks MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_handle.htm" target="_blank" >

Handle MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_hasattributes.htm" target="_blank" >

HasAttributes MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_hasextensiondictionary.htm" target="_blank" >

HasExtensionDictionary MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_insertionpoint.htm" target="_blank" >

InsertionPoint MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_layer.htm" target="_blank" >

Layer MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_linetype.htm" target="_blank" >

Linetype MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_linetypescale.htm" target="_blank" >

LinetypeScale MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_lineweight.htm" target="_blank" >

Lineweight MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_name.htm" target="_blank" >

Name MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_normal.htm" target="_blank" >

Normal MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_objectid.htm" target="_blank" >

ObjectID MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_objectname.htm" target="_blank" >

ObjectName MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_ownerid.htm" target="_blank" >

OwnerID MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_plotstylename.htm" target="_blank" >

PlotStyleName MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_rotation.htm" target="_blank" >

Rotation MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_TrueColor_property.htm" target="_blank" >

TrueColor MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_visible.htm" target="_blank" >

Visible MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_xscalefactor.htm" target="_blank" >

XScaleFactor MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_yscalefactor.htm" target="_blank" >

YScaleFactor MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_zscalefactor.htm" target="_blank" >

ZScaleFactor  

Events MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_modified.htm" target="_blank" >

Modified  

发表于 2006-5-19 08:46:00 | 显示全部楼层

睽睽

发表于 2006-5-19 09:21:00 | 显示全部楼层
个人觉得从AcadBlockReference中提取圆的参数,困难!不过可以得到它的name,然后得到对应的AcadBlock,在它里面提取圆的参数就容易了,没办法,变通一下。。。。
发表于 2006-5-21 15:00:00 | 显示全部楼层
我也面临类似的问题,看到帮助中说可以先把块参照给分解,然后再读取对象,可是分解后不知道怎么组合块参照了
发表于 2006-5-22 09:51:00 | 显示全部楼层

To 4 楼:

帮助里说的如果要在块参照中添加或删除对象,必须要先炸开。。。。你这么理解倒也无可厚非,在前面怎么组合块参照也提到了

VBA class name:

AcadBlockReference 

Create using:

ModelSpace.InsertBlock
PaperSpace.InsertBlock
Block.InsertBlock 

Access via:

ModelSpace.Item
PaperSpace.Item
Block.Item
SelectionSet.Item
Group.Item 

To create a block reference, first you must create a block definition, or block, by using the MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_add.htm" target="_blank" >Add method. Once created, you can insert an instance of this block into your drawing using the MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_insertblock.htm" target="_blank" >InsertBlock method.

意思就是说先在thisdrawing.application.activedocument.blocks中使用add增加一个块定义,然后用InsertBlock将分解后返回的对象添加到块定义中。。。。。

不过这种方法不太好,每提一回属性就要把块参照炸碎一回,这个不符合VBA的编程要求。。。。。

 楼主| 发表于 2006-5-22 16:51:00 | 显示全部楼层
在此先谢3楼楼主
发表于 2006-5-22 19:06:00 | 显示全部楼层

也许先在块定义前,获取块内对象的句柄,这样就通过句柄查看可能好些

发表于 2006-5-23 16:29:00 | 显示全部楼层

应该根据块参照的name属性,得到相应的块,然后取得块中圆的大小.得到块中圆的大小后,还需要检索块属性的scalefactor属性,可以知道块参照放大缩小的比例,然后就可以知道圆有多少大了.

发表于 2006-5-24 08:14:00 | 显示全部楼层

楼上说的很对,还要检测scalfactor属性,顶顶!

 楼主| 发表于 2006-5-25 16:03:00 | 显示全部楼层
這麼多大師能幫忙,真的感謝
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 02:22 , Processed in 0.175015 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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