64 Bit ObjectID

64 Bit ObjectID

Anonymous
Not applicable
680 Views
1 Reply
Message 1 of 2

64 Bit ObjectID

Anonymous
Not applicable
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
0 Likes
681 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Look on the AcadUtility object for a method that returns
the

objectid as a string (sorry, forget what it's
called).


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
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
0 Likes