how to use dxfcode.textfontfile , dxfcode.lineweight

how to use dxfcode.textfontfile , dxfcode.lineweight

Anonymous
Not applicable
760 Views
2 Replies
Message 1 of 3

how to use dxfcode.textfontfile , dxfcode.lineweight

Anonymous
Not applicable

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???

0 Likes
761 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

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

0 Likes
Message 3 of 3

Anonymous
Not applicable

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:

 

http://exchange.autodesk.com/autocad/enu/online-help/browse#WS1a9193826455f5ff18cb41610ec0a2e719-79d...

 

http://exchange.autodesk.com/autocad/enu/online-help/browse#WS1a9193826455f5ff18cb41610ec0a2e719-79f...



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

0 Likes