Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Positioning Dimensions with a CATIA Macro

Status
Not open for further replies.

RickyPhil

Mechanical
Jul 16, 2014
8
US
I am trying to make and position dimensions on a drawing using a macro. I can successfully create dimensions, and I found a method .moveValue that will move the dimension, but I can't figure out how to use it correctly.

From the help document:
MyDimension.MoveValue(X, Y, SubPart, DimAngleBehavior)

Here is what I am currently trying:
Dim pinDimElements(1)
Dim pinDim As Object
pinDimElements(1) = Array(drwPin) 'drwPin is a circle I created earlier in the code.
Dim selpoints(3)
selpoints(3) = Array(0, 0, 0, 0)
Set pinDim = oActiveView.Dimensions.Add(9, pinDimElements(1), selpoints(3), 4)
Dim test As Object
Set test = pinDim.moveValue(0.5 * 25.4, 0.5 * 25.4, 5, 0)

This code actually does move the dimension where I want it, but I get the error: "Object required"

Are there any examples macros for manipulating dimensions? I am not finding very much with Google.
 
Replies continue below

Recommended for you

I figured it out. I didn't realize I could just call the method.

Call pinDim.moveValue(0.5 * 25.4, 0.5 * 25.4, 5, 0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top