Message 1 of 2
64 Bit ObjectID
Not applicable
07-03-2008
10:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Help! i can't seem to get the object ID in 64 Bit autocad! i can get an objectID from ObjectID32, but it doesn't work... what i'm doing is grabbing the object id for a viewport and using that to make a field for the scale value... but alas, it errors on me if i use just ObjectID, but if i switch to ObjectID32 the field returns ####. i can manuely set it, but that defeats the automation part... stupid! so, is there a way to get the object id that anybody knows about?
here's my code:
Public Property Get ViewportScaleField() As String
Dim vp1 As AcadPViewport
Dim vp1pt1 As Variant
Dim objid As String
Dim scale_field As String
For Each layer In ThisDrawing.layers
If UCase(layer.Name) = "VP" Then
layer.LayerOn = True
layer.Freeze = False
End If
Next
Dim errornum As String
pickviewport:
On Error Resume Next
ThisDrawing.Utility.GetEntity vp1, vp1pt1, vbLf & "Select Viewport: "
errornum = Err.Number
If errornum = -2147352567 Then
ThisDrawing.Utility.Prompt vbLf & "Prematurly Ended "
Exit Property
End If
If Not errornum = 0 Then
ThisDrawing.Utility.Prompt vbLf & "Not a Viewport... Try Again "
GoTo pickviewport
End If
objid = vp1.ObjectID
scale_field = "SCALE: " & "%<\AcObjProp Object(%<\_ObjId " & objid & ">%).CustomScale \f ""%lu4%pr8%ct2%qf2816 = 1'-0\" & Chr(34) & Chr(34) & ">%"
ViewportScaleField = scale_field
End Property
here's my code:
Public Property Get ViewportScaleField() As String
Dim vp1 As AcadPViewport
Dim vp1pt1 As Variant
Dim objid As String
Dim scale_field As String
For Each layer In ThisDrawing.layers
If UCase(layer.Name) = "VP" Then
layer.LayerOn = True
layer.Freeze = False
End If
Next
Dim errornum As String
pickviewport:
On Error Resume Next
ThisDrawing.Utility.GetEntity vp1, vp1pt1, vbLf & "Select Viewport: "
errornum = Err.Number
If errornum = -2147352567 Then
ThisDrawing.Utility.Prompt vbLf & "Prematurly Ended "
Exit Property
End If
If Not errornum = 0 Then
ThisDrawing.Utility.Prompt vbLf & "Not a Viewport... Try Again "
GoTo pickviewport
End If
objid = vp1.ObjectID
scale_field = "SCALE: " & "%<\AcObjProp Object(%<\_ObjId " & objid & ">%).CustomScale \f ""%lu4%pr8%ct2%qf2816 = 1'-0\" & Chr(34) & Chr(34) & ">%"
ViewportScaleField = scale_field
End Property