When you move the mouse over an object in Vdraft, an object tip automatically appears which displays information relevant for that object - for example a line displays its length and angle from horizontal. Starting with Vdraft 2.2, you can have your own custom object tips displayed.
When deciding what to display for an object tip, Vdraft first looks to see if the object has any extended entity data (xdata) with the application name EntityTip. It then uses the next few pieces of xdata (up to four) for displaying the object tip. When combined with the fact that some types of xdata are automatically modified when the object is modified, this can be a very powerful and easy way to view custom information attached to an object.
The following Visual Basic code attaches text to the currently selected objects that will be displayed as object tips.
Dim Vdraft As Object Dim apps As Object Dim selection As Object Dim ent As Object Dim xdata As Object Set Vdraft = CreateObject("Vdraft.Application") Set apps = Vdraft.ActiveDocument.ApplicationIDs If Not apps.HasItem("EntityTip") Then apps.Add ("EntityTip") End If Set selection = Vdraft.ActiveDocument.Selection For i% = 1 To selection.Count Set ent = selection(i%) Set xdata = ent.xdata xdata.AddApplicationID "EntityTip" xdata.Add 1000, "This text will be displayed when" xdata.Add 1000, "the mouse moves over this object" Next i
Xdata comes in group code/data pairs. The group code describes what type of data will follow. In the previous example, the group code 1000 indicated that the data would be text. The following is a list of some of the xdata group code/data pairs that are used by Vdraft's custom object tips.
|1011||vector which is moved, scaled, rotated, mirrored, and stretched with the object|
|1012||vector which is scaled, rotated, and mirrored with the object|
|1013||vector which is rotated and mirrored with the object|
|1040||a real number|
|1041||a real number which is scaled with the object (distance)|
|1042||a real number which is scaled with the object (scale factor)|
|1070||a 16-bit integer|
|1071||a 32-bit integer|
112 Ohio Street Suite 202
Bellingham, Washington 98225
Phone: (360) 676-0999
Sales Only: (800) 877-1875
Tech Support: firstname.lastname@example.org