如何在AutoCAD VBA中获取块引用的坐标? [英] how to i get the coordinates of a block-reference in autocad-VBA?

查看:852
本文介绍了如何在AutoCAD VBA中获取块引用的坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取autocad块引用的坐标.

I am trying to get the coordinates of an autocad blockreference.

使用下面的代码,我可以在autocad中选择一个块引用,但是它始终显示(0,0,0)作为插入点...

With the code below I can pick a blockreference in autocad, but it always displays (0,0,0) as insertionpoint...

插入点是块的实际坐标吗?

Is the insertionpoint the actual coordinates of a block, or not?

Sub GetInsertpoint()
    Dim oEnt As AcadEntity
    Dim varPick As Variant
    Dim brBref As AcadBlockReference
    Dim arAttR As AcadAttributeReference
    Dim varAt As Variant
    Dim i As Double

    ThisDrawing.Utility.GetEntity oEnt, varPick, vbCr & "Get the block"
    If TypeOf oEnt Is AcadBlockReference Then
        MsgBox "Thank you, very nice!"
        Set brBref = oEnt
        MsgBox brBref.InsertionPoint(0) & brBref.InsertionPoint(1) & brBref.InsertionPoint(2)
    Else
        MsgBox "Not a block reference!"
        Exit Sub
    End If

End Sub

推荐答案

分解AcDbBlockReferance

Explode the AcDbBlockReferance

AcDbBlockReferance.explode();

AcDbBlockReferance.explode();

它将为您提供存在于BlockReferance中的实体.

It will give u entities present in BlockReferance.

这篇关于如何在AutoCAD VBA中获取块引用的坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆