Public Class Zoom
<CommandMethod("ZO")> _
Public Sub ZO()
Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument
Dim acDocEd As Editor = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.Editor
Dim acCurDb As Database = acDoc.Database
Dim acTypValAr(4) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.Operator, "<AND"), 0)
acTypValAr.SetValue(New TypedValue(DxfCode.Start, "TEXT,MTEXT"), 1)
acTypValAr.SetValue(New TypedValue(DxfCode.TextFontFile, "txt"), 2)
acTypValAr.SetValue(New TypedValue(DxfCode.lineweight, lineweight.lineweight030),3)
acTypValAr.SetValue(New TypedValue(DxfCode.Operator, "AND>"), 4)
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectAll(acSelFtr)
If acSSPrompt.Status <> PromptStatus.OK Then
Return
End If
Dim idCol As New ObjectIdCollection(acSSPrompt.Value.GetObjectIds())
ZoomObjects(idCol)
End Sub
acTypValAr.SetValue(New TypedValue(DxfCode.TextFontFile, "txt"), 2)
acTypValAr.SetValue(New TypedValue(DxfCode.lineweight, lineweight.lineweight030),3)
this two lines do not work.
what problem is it ???
and does it exist text hiegh and text width on dxfcode???
and i also have some question .
how can i get text and mtext properties on the drawing, such as text font, text height, text width
Dim acTypValAr(2) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.Operator, "<AND"), 0)
acTypValAr.SetValue(New TypedValue(DxfCode.Start, "TEXT,MTEXT"), 1)
acTypValAr.SetValue(New TypedValue(DxfCode.Operator, "AND>"), 2)
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectAll(acSelFtr)
If acSSPrompt.Status = PromptStatus.OK Then
' get text font, text hieght, text wdth
End If
did you check the below link:
http://exchange.autodesk.com/autocad/enu/online-help/search#WS1a9193826455f5ff18cb41610ec0a2e719-7a6...
You can also check below links for MTEXT and TEXT group code:
You can also use system variable. if you want to use selection filter, I will recommend you to use different color for different object. Filter with color is also available