Sub Ch10_InsertingABlock()' 定义块Dim blockObj As AcadBlockDim insertionPnt(0 To 2) As DoubleinsertionPnt(0) = 0insertionPnt(1) = 0insertionPnt(2) = 0Set blockObj = ThisDrawing.Blocks.Add (insertionPnt, "CircleBlock")' 向块中添加圆Dim circleObj As AcadCircleDim center(0 To 2) As DoubleDim radius As Doublecenter(0) = 0center(1) = 0center(2) = 0radius = 1Set circleObj = blockObj.Set circleObj = blockObj.AddCircle(center, radius)'获取插入点Dim returnPnt As VariantreturnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")' 插入块Dim blockRefObj As AcadBlockReferenceSet blockRefObj = ThisDrawing.ModelSpace.InsertBlock (returnPnt, "CircleBlock", 1#, 1#, 1#, 0)ZoomAllEnd Sub
回复 wsccmm 的帖子谢谢您,可是为什么用了您拷贝的源码后,无法实现ZOOMALL的功能呢?我鼠标点后,自动回到VBA操作菜单,再回CAD里未出现zoomall后的效果
thisdrawing.sendcommand("_zoom" & vbcr & "all" & vbcr)