×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Dimension1.GetValue wont work?

Dimension1.GetValue wont work?

Dimension1.GetValue wont work?

(OP)
Hi Guys,
I have a few bits of script that alter dimensions properties for me.
they work ok on my pc on R18 and I'm sure I have tried them on R21 as well.
When I try them on a work pc running R21 & R24 they come up with
an error "Object doesn't support this property or method Dimension1.GetValue"

any ideas ?

thanks
Alan

RE: Dimension1.GetValue wont work?

I suppose you should post a piece of the script with the error, before give you an answer...

In my (1 month and a half) experience I imagine that dimension1 is a wrong object that does not support that method.
For example if I use ".getCoordinates" with a hybridShapeExtremum instead of a point, it gives that error (in my case it happened).

RE: Dimension1.GetValue wont work?

(OP)
For some insane reason it's working today ?

I'm using a machine at another company's and it behaves really odd.

thanks anyway guys :)

RE: Dimension1.GetValue wont work?

(OP)
Could I ask someone to explain the line below?
I keep looking at the automation file but find info like this.
If i understood what it is actually telling me I wouldnt have to bother you guys so much :(

MyDimension.SetTolerances(iTolType, itolName, iUpTol, iLowTol, idUpTol, idLowTol, DisplayMode)

Could someone please give me an example of how you complete the line?

cheers guys

RE: Dimension1.GetValue wont work?

(OP)
Ok I found some code that I've added to what i already had and it gets the results I need.
Not pretty but it kind of works and I'm slowly (very slowly) starting to get the jist of how it works.
But,
Can anyone tell me why I have to run the script twice before it changes everything?

---------------------------------------------------------------------------------------------

Sub CATMain()

Dim documents1
Set documents1 = CATIA.Documents

Set Document = CATIA.ActiveDocument

Dim selection1
Set selection1 = Document.Selection

Set Info = selection1.Item(1)

Dim Dimension1
Set Dimension1 = Info.Value

Dim DimTolValue
Set DimTolValue = Dimension1

Dim oTolType
Dim oDisplayMode
Dim oTolName
Dim oUpTolS
Dim oLowTolS
Dim oUpTolD
Dim oLowTolD

DimTolValue.GetTolerances oTolType, oTolName, oUpTolS, oLowTolS, oUpTolD, oLowTolD, oDisplayMode

oTolName = "TOL_NUM2"
oUpTolD = 0.2
oLowTolD = -0.0

DimTolValue.SetTolerances oTolType, oTolName, oUpTolS, oLowTolS, oUpTolD, oLowTolD, oDisplayMode

Dim DimDimValue
Set DimDimValue = Dimension1.GetValue

DimDimValue.SetFormatName 1, "ANS.DIMM"
DimDimValue.SetFormatPrecision 1, "0.100" 'precision

Dim oNoOff
oNoOff=InputBox ( "Enter No Off Holes" )
Dim oNoOffText
oNoOffText = "("& oNoOff &"x) "

Dim oBefore
oBefore =oNoOffText
Dim oAfter
oAfter =" THRO'"
Dim oUpper
'oUpper = "Upper"
Dim oLower
'oLower = "Lower"

Dimension1.GetValue.SetBaultText 1, oBefore, oAfter, oUpper, oLower

Dim myDim 'As DrawingDimension
Set myDim = CATIA.ActiveDocument.Selection.Item(1).Value
Dim myDimLine 'As DrawingDimLine
Set myDimLine = myDim.GetDimLine
myDimLine.DimLineGraphRep = catDimLine2Parts

MyDim.RestoreValuePosition()

End Sub

----------------------------------------------------------------------------------------


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources