.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selection Sets & Attributs with .NET

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
172 Views, 0 Replies

Selection Sets & Attributs with .NET

I am trying to grab titleblock attributes, cycle through the titleblocks and
clear the attribute. Meaning if the user typed someting in I won't to make
sure nothing is in the attribute. I could do this in VB6 but with .NET I am
struggling. The only thing I am thinking is wrong is my variable Attrib is
and Object and in VB6 it was a variant. The other thing I think might be
wrong is the SStitle.Item(j).Update() at the bottom of the code.

Does anyone have any ideas??

Here is my code:
Dim intCode(2) As Integer, varValue(2) As Object, Attrib As Object
Dim SStitle As Autodesk.AutoCAD.Interop.AcadSelectionSet
intCode(0) = 0 : varValue(0) = "INSERT"
intCode(1) = 2 : varValue(1) = "Sheet Text " & strTitle
intCode(2) = 8 : varValue(2) = "A-Tblk-Text"
On Error Resume Next
SStitle = ThisDrawing.SelectionSets.Add("TitleBlock") 'make a new selection
set
If Err.Number Then 'if the selection set already exists this will handle it
Err.Clear() 'clear the error flag
SStitle = ThisDrawing.SelectionSets.Add("TitleBlock") 'use the existing
'On Error GoTo errReport
End If
SStitle.Clear() 'clear out the selection set
SStitle.Select(Autodesk.AutoCAD.Interop.Common.AcSelect.acSelectionSetAll, ,
, intCode, varValue) 'make the selection based on the filters
For j = 0 To SStitle.Count - 1
Attrib = SStitle.Item(j).GetAttributes() 'Get the attributes from the
titleblock
strTitleDesc = UCase(txtTitle.Text)
If Attrib(0).TextString = strShtName Then
If optClearText.Checked = True Then
For k = 2 To 14
Attrib(k).TextString = " "
Next k
SStitle.Item(j).Update()
next j
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost