Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Axis Legs as a Direction

Status
Not open for further replies.

jzecha

Aerospace
Jan 20, 2016
235
0
0
US
Can someone tell me how you reference the Axis Legs of a newly created Axis System?

I am trying to create an Extremum and use the 3 Different Axis Legs of my newly created Axis System, but nothing I have tired is working correctly and I am having no luck finding the correct answer on Google.


Code:
Dim axisSystems1 As AxisSystems
Set axisSystems1 = oPart.AxisSystems

Dim axisSystem1 As AxisSystem
Set axisSystem1 = axisSystems1.Add()
axisSystem1.OriginType = catAxisSystemOriginByPoint
axisSystem1.OriginPoint = oHybridshapePointCoord
axisSystem1.XAxisType = 0
axisSystem1.XAxisDirection = reference8
axisSystem1.YAxisType = Empty
axisSystem1.ZAxisType = Empty

Dim hybridShapeDirection10 As HybridShapeDirection
Set hybridShapeDirection10 = ????????????

Dim oReference99 As Reference
Set oReference99 = oPart.CreateReferenceFromObject(oPartDocument.Part.MainBody)   
     
Dim hybridShapeExtremum1 As HybridShapeExtremum
Set hybridShapeExtremum1 = oHybridShapeFactory.AddNewExtremum(oReference99, hybridShapeDirection10, 1)
oHybridBody.AppendHybridShape hybridShapeExtremum1
 
Replies continue below

Recommended for you

Hello, what's your exact purpose of macro? I use VBScript for macros but u can convert it into VBA easly. Trying to answer your question about only leg ref.: you can refer your "Legs" by adding reference to them for e.g:

Code:
axisSystem2.XAxisType = catAxisSystemAxisSameDirection

Set reference4 = part1.CreateReferenceFromObject(hybridShapeLinePtPt1)

axisSystem2.XAxisDirection = reference4

axisSystem2.YAxisType = catAxisSystemAxisByCoordinates
For example in 2nd line I used PtPt1 - means line point-point (earlier created which you need to create if you want to refer to X axis to line)

Regards,
M
 
I am creating an optimized bounding box depending on what inputs you have.

The provided script from you specifies the X and Y axis of the Axis System.

In my code, I already have created the Axis System only specifying the X Axis and the Y and Z are just defaulted, which is the way I want it.

Now I need to a way to reference the Y and Z legs of the new Axis System to specify a direction in my Extremum.

Does that make sense?
 
jzecha, there is an OOB bounding-box function in Core-Cavity Workbench (shareable CCV)
2023-01-12_09-27-43_b4odjy.jpg


regards,
LWolf
 
looking at the chm file i find that AxisSystem do have GetYAxis Method.. could that help?

2023-01-12_8-11-50_x9losb.png


Eric N.
indocti discant et ament meminisse periti
 
That worked @itsmyjob, but I was hoping to find some way of referencing the Axis leg itself instead of creating coordinates.
Either way, thanks for the help in pointing me in the right direction.
 
Status
Not open for further replies.
Back
Top