Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Running CATScript for distance calculation in interactive mode vs batch mode

Status
Not open for further replies.

22555

Automotive
Dec 17, 2003
24
Hi,

I am doing distance calculation between 2 products using following code. I am getting different values while running the same code in interactive mode versus batch mode. Any help to resolve this would be appreciated. Thanks

Dim cDistances As Distances
Set cDistances = RootProduct.GetTechnologicalObject("Distances")

Dim NewDistance 'As Distance
Set NewDistance = cDistances.Add
oGroup1.AddExplicit Product1
oGroup2.AddExplicit Product2

NewDistance.FirstGroup = oGroup1
NewDistance.SecondGroup = oGroup2
NewDistance.ComputationType = catDistanceComputationTypeBetweenTwo
NewDistance.MeasureType = catDistanceMeasureTypeMinimum
NewDistance.Compute
 
Replies continue below

Recommended for you

Hi Little,

Here is the code for the function to measure distance between 2 selection. Not sure why values are different in batch mode versus interactive mode. Do you think of any tools-option settings?

' Retrieve the group of all components
Dim cGroups1 'As AnyObject
Set cGroups1 = Product1.GetTechnologicalObject("Groups")
Dim oGroup1 As Group
Set oGroup1 = cGroups1.Add
oGroup1.AddExplicit Product1

Dim oGroup2 As Group
Set oGroup2 = cGroups1.Add
oGroup2.AddExplicit Product2

' Retrieve the Distances collection
Dim cDistances As Distances
Set cDistances = RootProduct.GetTechnologicalObject("Distances")

' Measure Distance
Dim NewDistance 'As Distance
Set NewDistance = cDistances.Add
oGroup1.AddExplicit Product1
oGroup2.AddExplicit Product2

NewDistance.FirstGroup = oGroup1
NewDistance.SecondGroup = oGroup2
NewDistance.ComputationType = catDistanceComputationTypeBetweenTwo
NewDistance.MeasureType = catDistanceMeasureTypeMinimum
NewDistance.Compute

Set objDistance = NewDistance


Dim Distance As Double
Distance = NewDistance.Value

' Get Coordinates
NewDistance.GetFirstPointCoordinates (oCoord1)
NewDistance.GetSecondPointCoordinates (oCoord2)
 
Dear All,

I am planning to write a VB script in Catia for Hatching the Section views. I know if we take section view in Catia by default it will give hatching, but hatching standard and pitch is not same for all. So planning this Macro. But i have one question how the macro will read the boundary of the objects to provide the different types of hatching. can anyone help me on this?
 
@22555
What kind of settings do you have in interactive mode when you measure? Are you in an assembly? Is it in design mode?
Do you have the same SAG for both cases? How much is the difference between your cases?
I suppose you are running batch mode on more parts...can you try only on one part? And what does it mean for you batch mode? with visualization or without?
By the way, check also this article

@pradeepa123
I don't think is possible what you want.

Regards
Fernando

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor