selection filter text papersize
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm writing a code to change the color of all text in a drawing depending on text size.
Thickness has te be 1/10 of the textheight.
Text with a papersize of 2.5 should get a color that has a thickness of 0.25 mm in the pentable.
At the moment this is the only code that works but i have to link the selectionfilter to a textstyle.
My code:
' Start a transaction
Using acTrans As Transaction = db.TransactionManager.StartTransaction()
Dim mytextstyle(0) As TypedValue
'' Create a TypedValue array to define the filter criteria
mytextstyle.SetValue(New TypedValue(DxfCode.TextStyleName, "text2.5"), 0)
Dim selectiefilter As New SelectionFilter(WFO)
'' Request for objects to be selected in the drawing area
Dim acSSPrompt As PromptSelectionResult = ed.SelectAll(selectiefilter)
'' If the prompt status is OK, objects were selected
If acSSPrompt.Status = PromptStatus.OK Then
Dim acSSet As SelectionSet = acSSPrompt.Value
'' Step through the objects in the selection set
For Each acSSObj As SelectedObject In acSSet
'' Check to make sure a valid SelectedObject object was returned
If Not IsDBNull(acSSObj) Then
'' Open the selected object for write
Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, _
OpenMode.ForWrite)
If Not IsDBNull(acEnt) Then
'' Change the object's color
acEnt.ColorIndex = 7
End If
End If
Next
End If
'' Save the new object to the database
acTrans.Commit()
'' Dispose of the transaction
End Using
(repeated with different text styles text5, text3.5, text1.5)
The textstyle text2.5 has a papersize of 2.5 but when i scale the text to 5 for example it will not change its color to the right of course.
I know i can use dxfCode.txtPsize but how can i use an selectionfilter that filters textsize between two values?