急!请教CAD VBA里想做成一个块,对象是选择集里的内容,请问该用什么语句?(有个例子也可以!)
1个回答
展开全部
Sub Example_AddMInsertBlock()
Dim circleObj As AcadCircle
Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
Dim radius As Double
Dim newMBlock As AcadMInsertBlock
Dim newBlock As AcadBlock
Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")
Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)
Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)
CAD帮助中的方法, 把Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)改成你的选集entity对象 就可以了
Dim circleObj As AcadCircle
Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
Dim radius As Double
Dim newMBlock As AcadMInsertBlock
Dim newBlock As AcadBlock
Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")
Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)
Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)
CAD帮助中的方法, 把Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)改成你的选集entity对象 就可以了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询