Urgent Need Help

Urgent Need Help

Anonymous
Not applicable
274 Views
3 Replies
Message 1 of 4

Urgent Need Help

Anonymous
Not applicable
Hi All,
I want to select all the dimensions and assign unique names or parameters to them in Autocad Drawing..
For Rotated dimensions(D1=--,D2=--,D3=--..........)
Angular dimensions(A1--,A2--.........)
Radial Dimensions(R1=--,R2=--........)
This goes on for all kind of Dimensions
Here is the code what i have designed but the problem is that
i assigns same name to all the dimensions

Dim sset As AcadSelectionSet
Dim acdim As AcadDimension
Dim angle As AcadDimAngular
Dim radius As AcadDimRadial
Dim rot As AcadDimRotated
Public FilterType(1) As Short
Public FilterData(1) As Object

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

sset = acadDoc.SelectionSets.Add("s2")
sset = acadDoc.SelectionSets.Add("Name")
FilterType(0) = 0
FilterData(0) = "DIMENSION"
FilterType(1) = 67
FilterData(1) = "0"

sset.Select(AcSelect.acSelectionSetAll, , , FilterType, FilterData)
j = 1
For Each acdim In sset
acdim.TextOverride = "d" & j & "=<>"
' 'radius.TextOverride = "rad" & "=<>"
' 'angle.TextOverride = "ang" & "<>"
j = j + 1
acdim.Update()

Next acdim
0 Likes
275 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi,

Here's you're code (rewritten) in .NET for dimensions
AutoCAD 2008, VS2005

already build, load the DimensionTextOverride.dll in the bin folder with netload.

(not checked if it works in Autocad 2007)

A Caddie
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi,
You will need to check the type of each dimension and use appropriate prefix:

[code]

For Each acdim In sset
If TypeOf acdim Is AcadDimAngular Then
acdim.TextOverride = "ang" & j & "="
ElseIf TypeOf acdim Is AcadDimRadial Then
acdim.TextOverride = "rad" & j & "="
Else
acdim.TextOverride = "d" & j & "="
End If

j += 1

acdim.Update()

Next acdim

[/code]

HTH,
Alan
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thank You ,
it worked.my next problem is adding prefix to the text which is already overridden.
0 Likes