aslam,
This might get to started. it creates a view name based on the selection set
of text string found on layer name "bldgnos" and zooms to that location as
it finds each item.
Hope this helps
John Coon
Private Sub CommandButton1_Click()
UserForm1.Hide
Dim Entity As AcadEntity
Dim FilterData(0 To 0) As Variant
Dim FilterType(0 To 0) As Integer
Dim SelectionSet As AcadSelectionSet
Dim Text As AcadText
Dim View As AcadView
Dim ViewCenter(0 To 1) As Double
Dim magnification As Double
Dim zcenter(0 To 2) As Double
For Each SelectionSet In ThisDrawing.SelectionSets
If SelectionSet.Name = "BldgNos" Then
SelectionSet.Delete
Exit For
End If
Next SelectionSet
Set SelectionSet = ThisDrawing.SelectionSets.Add("BldgNos")
FilterType(0) = 8
FilterData(0) = "BldgNos"
SelectionSet.Select acSelectionSetAll, , , FilterType, FilterData
' Zoom to each text entity in the selection set and name the view.
For Each Entity In SelectionSet
If TypeOf Entity Is AcadText Then
Set Text = Entity
Set View = ThisDrawing.Views.Add(Text.TextString)
ViewCenter(0) = Text.InsertionPoint(0)
ViewCenter(1) = Text.InsertionPoint(1)
View.Width = 200
View.Height = 200
View.Center = ViewCenter
zcenter(0) = ViewCenter(0): zcenter(1) = ViewCenter(1): zcenter(2) = 0
magnification = 200
ZoomCenter zcenter, magnification
End If
Next Entity
SelectionSet.Delete
ZoomExtents
UserForm1.Show
End Sub
wrote in message news:5274071@discussion.autodesk.com...
Hello All,
I want to select object in the drawing programatically. how can i achieve
this. I have got Handle in string format. What i have done is:-
ObjectId = Database.GetObjectId(false,GetHandle(hexhandle),1);
objectId.GetObject(OpenMode.ForRead);
Now I want to select this object and after selecting , i want to zoom this
object.
Help Plz.
Thanks,,,