.NET

.NET

Reply
Contributor
hoyin0820
Posts: 15
Registered: ‎08-09-2013
Message 1 of 3 (111 Views)

how to use dxfcode.textfontfile , dxfcode.lineweight

111 Views, 2 Replies
09-10-2013 02:05 AM

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

Contributor
hoyin0820
Posts: 15
Registered: ‎08-09-2013
Message 2 of 3 (95 Views)

Re: how to use dxfcode.textfontfile , dxfcode.lineweight

09-10-2013 06:25 AM in reply to: hoyin0820

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

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 3 of 3 (86 Views)

Re: how to use dxfcode.textfontfile , dxfcode.lineweight

09-10-2013 06:56 AM in reply to: hoyin0820

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.