CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 3287 

CAD tip CAD tip # 1214:

Question CAD 
 %  platform  category 
Q - question

How to get the "prompt" property from "attribute" objects in VBA?

A - answer Use the following VBA code (assuming a block named "TEST"):

Sub test()
    Dim blkdef As AcadBlock
    Dim elem As Object
    Dim strPrompt As String
        
    On Error Resume Next
    Set blkdef = ThisDrawing.Blocks.Item("TEST")
    For i = 0 To blkdef.Count
        Set elem = blkdef.Item(i)
        If StrComp(elem.EntityName, "AcDbAttributeDefinition", 1) = 0 Then
            strPrompt = elem.PromptString
        End If
    Next i
End Sub
ACAD2000
100% *  CAD 
4.4.2001    6997x  
Comments   Tell a friend
applies to: AutoCAD 2000 ·


Back   All CAD Tips All CAD tips&tricks

Does 3D Studio VIZ, MAX and LightScape make use of a second processor in my PC? « | » Feature codes for Network License Manager.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info


Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist