What's new

I have in mind to now look at creating a bolt/washer/washer/nut sub assembly

albie0803

Alibre Super User
Yes, downloaded latest beta today

AssembledPart doesn't have an entry in the reference so I'm not sure what to do with it.
 

albie0803

Alibre Super User
You don't see this?

:oops: AssembledPart does not bring up anything in the index search.

When you add a subassembly to an assembly the function returns an AssembledSubAssembly object. When you add a part to an assembly the function returns an AssembledPart object. Add constraints between these AssembledXXX objects.

Is this the sort of thing you mean?

Code:
sub_assy = ca.AddSubAssembly(subassy,0,0,0)
# sub_assy is an AssembledSubAssembly object.
ca.AddMateConstraint(0, sub_assy, sub_assy.YZPlane, P1, own_face)
# so this should work (theoretically)
 

ajayre

Alibre Super User
:oops: AssembledPart does not bring up anything in the index search.

What about going through the contents like my screenshot?

Yes, ca.AddSubAssembly will return an AssembledSubAssembly object, which is a instance (e.g. a copy) of an assembly.

Andy
 

albie0803

Alibre Super User
So, I have my constraints working, almost. I have constrained the main axis of my bolt subassembly to a hole by clicking the bore face of the hole.. The constraint has connected to the tube of the hole, not the centre of the hole, meaning that I can drag the bolt around the edge of the hole. Because there are multiple types of the bolt I can't use a set face as, no doubt, it would be different for each one. Is there an easy way to correctly mate to the "axis" of the hole, would I need to create an axis in the selected hole or would I be better to work out which is the correct face for each bolt type and use that as a "tube-to-tube mate?
 

oldfox

Alibre Super User
would I be better to work out which is the correct face for each bolt type and use that as a "tube-to-tube mate?

Hi Albie,

The only constraint I use for screws and shafts in bearings is "align - cylinder face to cylinder face" NOT a mate. Never had any problems with that.
If you are running a script, yes, you would need to have the face number in lieu of the script prompting for a face. (If that works in AS 2019)

Hang in there. Sounds like you're getting the better of the monster. Can't wait to see the final release.:D
 

NateLiquidGravity

Alibre Super User
You can also use the hole's edge instead of a hole' face.

In the next release of Alibre Design the following should be possible to script:
Pull ALL edges from user selected face.
Check if each edge has a diameter.
Check if that diameter fits fastener.
Add Fastener constrained to face and edge for everywhere it fits.
 

idslk

Alibre Super User
Nate, you're right on one hand.
It will be also usefull for those:
upload_2019-6-20_20-0-23.png
and so on

A few month ago i made me a little test part:
upload_2019-6-20_20-5-55.png

The holes in are made in various ways and for example i didn't found a good way to recognize the holes made from the thread tool (and some other things...)
If the Script should be universal, it should be able to handle different "hole situations" in my opinion...
I'm interested in your good ideas;)

Regards
Stefan

PS.: @oldfox and @albie0803: For the screw script it should be mentioned that standard screws have also standard lengths...
 

ajayre

Alibre Super User
A few month ago i made me a little test part:
View attachment 27771

The holes in are made in various ways and for example i didn't found a good way to recognize the holes made from the thread tool (and some other things...)
If the Script should be universal, it should be able to handle different "hole situations" in my opinion...

The problem is that holes made this way are features, they are not sketches. All features do is create more faces with more complex shapes and more edges. How should a script be able to make sense of that from a collection of faces and edges? Can you provide an example?

Andy
 

NateLiquidGravity

Alibre Super User
I think I have a method that would work by looping through multiple levels of edges and adjoining faces. It would not perfectly identify every case though.

If we could know if a face is flat that would help. Also If we could know if a cylindrical face's normals point inward (it's a hole) vs if they point outward (it's a post) it would definitely help.

Something i can't figure out how to do automatically is calculate bolt lengths when bolting two or more parts. That will require user input.
 
Something i can't figure out how to do automatically is calculate bolt lengths when bolting two or more parts. That will require user input.
Nate -- Using (American inch, at least) Unified National "bolts," Their "length values" are (relatively) easy to calculate from their basic Major Diameter. A Nut (under Unified National specification is equally simple to determine. It is the Washer that varies as to whether ir is a USS (ANSI Type A), SAE J2655 (ANSI Type B), or a Fender Washer. Unfortunately since the United States eliminated the National Bureau of Standards (in 1986) and the American National Standards Institute (in 2009), no "Standards" have a "legal" authority in the United States of America!
 

ajayre

Alibre Super User
Irrelevant to this. Discussion is how to automatically determine needed length based on the geometry in the assembly.

Andy
 

idslk

Alibre Super User
Discussion is how to automatically determine needed length based on the geometry in the assembly
Thought about it and think that it would be ok for me to click on a start and an end face for the length and as i mostly pick the cylindrical face instead of the edge (it's easier to match...) it would be good to have a function which returns the diameter of such a cylindrical face...(and if i'm allowed to dream: for each of round type geometries an center/axis...;-))

The other question was if i click on a hole which is made with the hole tool, are the any data which say it's a hole-tool-hole maybe in AlibreX.dll ?

Regards
Stefan
 

ajayre

Alibre Super User
You can get the diameter of a circular/arc shaped edge. E.g. MyEdge.Diameter. Will return zero for non-circular edges.

It's possible to find the center but it's a bit involved. This might give you some hints.

Start off with CylinderFace = the face on the outside of a cylinder, e.g. selected by the user. Will require 2019 beta.

Code:
Prt = CylinderFace.GetPart()
Diameter = CylinderFace.Edges[0].Diameter
Radius = Diameter / 2.0

CylinderEnds = CylinderFace.GetAdjoiningFaces()
CylinderLength = CylinderEnds[0].DistanceTo(CylinderEnds[1])

ThreadAxis = Prt.AddAxis('Thread axis', CylinderFace)

StartPlane = Prt.AddPlane('Start Plane', CylinderEnds[0], 0)
EndPlane = Prt.AddPlane('End Plane', CylinderEnds[1], 0)

StartPoint = Prt.AddPoint('Start Point', ThreadAxis, StartPlane)
EndPoint = Prt.AddPoint('End Point', ThreadAxis, EndPlane)

Now StartPoint and EndPoint are the points in the center of each end of the cylinder and you can read out their coordinates using the X, Y and Z properties on each.

Andy
 

ajayre

Alibre Super User
The other question was if i click on a hole which is made with the hole tool, are the any data which say it's a hole-tool-hole maybe in AlibreX.dll ?

The API looks like it has full support for creating and reading out information about hole features, including getting their locations. None of this is supported in Script. If you want it then submit a request to Alibre support.

Andy
 
Top