Sign in to follow this  
Followers 0
katro

I want read AutoCAD Text .

1 post in this topic

#1 ·  Posted (edited)

I have read, but want to view the source code is not very good.
Help me what to do.

$oAcad = ObjGet("","AutoCAD.Application")

If @error Then
    Msgbox(0,"ObjGet","Failed to open AutoCAD.Application.16 Object. Error code: " & @error)
    Exit
Endif

$strActiveDocument = $oAcad.Activedocument.Name
MsgBox(0,"Name",$strActiveDocument)

$iBlocks = $oAcad.Activedocument.Blocks.Count
MsgBox(0,"Count",$iBlocks)
For $i = 0 to $iBlocks -1
    $strBlockName = $oAcad.Activedocument.Blocks.Item($i).name
    If $strBlockName = "" Then
        $iAttributes = $oAcad.Activedocument.Blocks.Item($i).GetAttributes()
        MsgBox(0,"GetAttributes()",$iAttributes)
    EndIf
Next

 

Edited by Jos
added codebox
1 person likes this

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0