Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

How can we use reference in loop, t 1

Status
Not open for further replies.

Neerajjo

Automotive
Joined
Jan 13, 2021
Messages
45
Location
IN
How can we use reference in loop, to generate multiple points.
 
thanks Lwolf , Code is working.
 
How can i measure angle between two line?

I made the code but formula not taking line reference , i have write the name of line but its not taking.



Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory

Dim hybridShapePointOnCurve1 As HybridShapePointOnCurve
Set hybridShapePointOnCurve1 = hybridShapeFactory1.AddNewPointOnCurveWithReferenceFromDistance(reference2, reference1, D * i, False)


hybridShapePointOnCurve1.DistanceType = 1


hybridBody1.AppendHybridShape hybridShapePointOnCurve1


part1.InWorkObject = hybridShapePointOnCurve1

' creating plane

Dim hybridShapePlaneNormal1 As HybridShapePlaneNormal
Set hybridShapePlaneNormal1 = hybridShapeFactory1.AddNewPlaneNormal(reference2, hybridShapePointOnCurve1)

hybridBody1.AppendHybridShape hybridShapePlaneNormal1

part1.InWorkObject = hybridShapePlaneNormal1

'Intersection curve
Dim hybridShapeIntersection1 As HybridShapeIntersection
Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(hybridShapePlaneNormal1, surface)

hybridShapeIntersection1.PointType = 0

hybridBody1.AppendHybridShape hybridShapeIntersection1

part1.InWorkObject = hybridShapeIntersection1

' selecting near curve

Dim hybridShapeNear1 As HybridShapeNear
Set hybridShapeNear1 = hybridShapeFactory1.AddNewNear(hybridShapeIntersection1, hybridShapePointOnCurve1)

hybridBody1.AppendHybridShape hybridShapeNear1

part1.InWorkObject = hybridShapeNear1

' Making tangent curve on near curve



Dim reference21 As Reference
Set reference21 = part1.CreateReferenceFromObject(hybridShapeNear1)


Dim reference22 As Reference
Set reference22 = part1.CreateReferenceFromObject(hybridShapePointOnCurve1)



Dim reference23 As Reference
Set reference23 = part1.CreateReferenceFromObject(hybridShapePlaneNormal1)

Dim hybridShapeLineTangency1 As HybridShapeLineTangency
Set hybridShapeLineTangency1 = hybridShapeFactory1.AddNewLineTangencyOnSupport(reference21, reference22, reference23, 0#, 10#, False)

hybridBody1.AppendHybridShape hybridShapeLineTangency1





'creating line on giving direction

Dim hybridShapeLinePtDir1 As HybridShapeLinePtDir
Set hybridShapeLinePtDir1 = hybridShapeFactory1.AddNewLinePtDir(hybridShapePointOnCurve1, direction, 0#, 5#, False)

Dim hybridBody2 As HybridBody
Set hybridBody2 = hybridBodies1.Item("Geometrical Set.1")

hybridBody2.AppendHybridShape hybridShapeLinePtDir1

part1.InWorkObject = hybridShapeLinePtDir1



'creating angle measure

Dim parameters1 As Parameters
Set parameters1 = part1.Parameters

Dim angle1 As Angle
Set angle1 = parameters1.CreateDimension("", "ANGLE", 0#)

Dim relations1 As Relations
Set relations1 = part1.Relations

Dim formula1 As Formula
Set formula1 = relations1.CreateFormula("Formula.6", "", angle1, "angle(`Geometrical Set.1\hybridShapeLineTangency1` ,`Geometrical Set.1\hybridBody2` ) ")

formula1.Rename "Formula.1"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top