What's wrong?

What's wrong?

Anonymous
Not applicable
430 Views
6 Replies
Message 1 of 7

What's wrong?

Anonymous
Not applicable
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
431 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionStyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
Message 3 of 7

Anonymous
Not applicable
Yes, I want to set the suffix to a value of sModelValue. (maybe you can come
up with the other ways to do this - pls. see tha att. file)
It's kind of odd thing to do but I want to show the primary with tolerances
and the second as a default value
Thax


"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091437@discussion.autodesk.com...
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionStyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
Message 4 of 7

Anonymous
Not applicable
You can use FormattedText to specify the contents of a dimension. I've
modified your sample below to demonstrate this:

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDim.Text.FormattedText = " [" & sModelValue & "]"
Next
End Sub


Sanjay-


"Chris (IV10 Pro. SP3a)" wrote in message
news:5091439@discussion.autodesk.com...
Yes, I want to set the suffix to a value of sModelValue. (maybe you can come
up with the other ways to do this - pls. see tha att. file)
It's kind of odd thing to do but I want to show the primary with tolerances
and the second as a default value
Thax


"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091437@discussion.autodesk.com...
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionS
tyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" > wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNu
mber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
Message 5 of 7

Anonymous
Not applicable
Thanks, San. I did use Formattext and it worked fine .The only problem: it
is not associated with the model then I tried to pass the model value to the
suffix ... What I try to do here is when I change the model, the value on
.idw should be changed accordingly

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091482@discussion.autodesk.com...
You can use FormattedText to specify the contents of a dimension. I've
modified your sample below to demonstrate this:

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDim.Text.FormattedText = " [" & sModelValue & "]"
Next
End Sub


Sanjay-


"Chris (IV10 Pro. SP3a)" wrote in message
news:5091439@discussion.autodesk.com...
Yes, I want to set the suffix to a value of sModelValue. (maybe you can come
up with the other ways to do this - pls. see tha att. file)
It's kind of odd thing to do but I want to show the primary with tolerances
and the second as a default value
Thax


"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091437@discussion.autodesk.com...
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionS
tyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" > wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNu
mber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
Message 6 of 7

Anonymous
Not applicable
This change will not be automatic. In order to achieve this, you will need
to listen to events (DrawingViewEvents.OnViewUpdate, for instance) and
update the text accordingly.

Sanjay-

"Chris (IV10 Pro. SP3a)" wrote in message
news:5091474@discussion.autodesk.com...
Thanks, San. I did use Formattext and it worked fine .The only problem: it
is not associated with the model then I tried to pass the model value to the
suffix ... What I try to do here is when I change the model, the value on
.idw should be changed accordingly

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091482@discussion.autodesk.com...
You can use FormattedText to specify the contents of a dimension. I've
modified your sample below to demonstrate this:

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDim.Text.FormattedText = " [" & sModelValue & "]"
Next
End Sub


Sanjay-


"Chris (IV10 Pro. SP3a)" wrote in message
news:5091439@discussion.autodesk.com...
Yes, I want to set the suffix to a value of sModelValue. (maybe you can come
up with the other ways to do this - pls. see tha att. file)
It's kind of odd thing to do but I want to show the primary with tolerances
and the second as a default value
Thax


"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091437@discussion.autodesk.com...
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionS
tyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" > wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNu
mber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes
Message 7 of 7

Anonymous
Not applicable
San,
Do you have any sample code to share???
Thx

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091551@discussion.autodesk.com...
This change will not be automatic. In order to achieve this, you will need
to listen to events (DrawingViewEvents.OnViewUpdate, for instance) and
update the text accordingly.

Sanjay-

"Chris (IV10 Pro. SP3a)" wrote in message
news:5091474@discussion.autodesk.com...
Thanks, San. I did use Formattext and it worked fine .The only problem: it
is not associated with the model then I tried to pass the model value to the
suffix ... What I try to do here is when I change the model, the value on
.idw should be changed accordingly

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091482@discussion.autodesk.com...
You can use FormattedText to specify the contents of a dimension. I've
modified your sample below to demonstrate this:

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNumber(dModelValue, 4, 0)
oDim.Text.FormattedText = " [" & sModelValue & "]"
Next
End Sub


Sanjay-


"Chris (IV10 Pro. SP3a)" wrote in message
news:5091439@discussion.autodesk.com...
Yes, I want to set the suffix to a value of sModelValue. (maybe you can come
up with the other ways to do this - pls. see tha att. file)
It's kind of odd thing to do but I want to show the primary with tolerances
and the second as a default value
Thax


"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5091437@discussion.autodesk.com...
Several things 🙂

1. The oDimStyle object is never intialized. You need to set it to an
existing DimensionS
tyle.
2. You are attempting to set oDimStyle.Suffix to "sModel". Did you mean
"sModelValue"?
3. Most importantly, are you sure you want to set the suffix of a dimension
style to this value? This will cause all dimensions that use this particular
dimension style to get this suffix.

Could you explain what exactly you are attempting? Seems like you want to
change the precision of a dimension (settable using
DrawingDimension.Precision)??

Sanjay-

"Chris (IV10 Pro. SP3a)" > wrote in message
news:5091338@discussion.autodesk.com...
can anyone find out what's wrong here?
Thx

Public Sub ShowBasicDimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDim As DrawingDimension
Dim oDimStyle As DimensionStyle
Dim sSuffix As String
For Each oDim In oDoc.SelectSet
Dim dModelValue As Double
dModelValue = oDim.ModelValue / 2.54
Dim sModelValue As String
sModelValue = FormatNu
mber(dModelValue, 4, 0)
oDimStyle.Suffix = sModel
Next
End Sub


--
IV10 Pro. sp3a
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 7.1.8.4
0 Likes