What's new

Using Python to make my first "Alibre Motion"

Suppakit

Member
Alibre Sample Motion
Hello everyone, I just make my dream come true for done Alibre motion by using Alibre script, but this is just the beginning, I have a plan to make API for my customers who don't like to learn Python, anyway I need more suggestion for how to manipulate 6 Axis robot motion is it possible, I need to make the simulation machine by using the robot as well.
The video I just upload on youtube bellow,
 

idslk

Alibre Super User
Hello everyone, I just make my dream come true for done Alibre motion by using Alibre script, but this is just the beginning,
would be nice if you would post the script..and may some infos about...;)

1683036066399.png

Regards
Stefan
 

Suppakit

Member
Sorry @Suppakit ,

i thought you would reply...
may others would take a look at an old post Motion Studies for more information. (incl. the script behind the dream...)
View attachment 38983
Regards
Stefan
Hi Stefan,
Sorry for the late reply of time zone, honestly I have very excited and forgot to post the reference source from your old post Motion Studies I really appreciate and it is my inspiration and idea to make Alibre more powerful without an Addon or new future upgrade version, I just done it for May 1st and my code has developed from your code and I think everyone can develop from my code too:)

1683075438044.png
Code for 'Rotation' : Cr @idslk

Win = Windows()
ScriptName = 'Rotation'
Win.InfoDialog('MET - Alibre Rotation start?', 'Mechatronics Designed Co.,Ltd.')
Options = []
Options.append(['Constrain A?', WindowsInputTypes.String,'A1'])
Options.append(['Rotate speed?', WindowsInputTypes.Integer, 20])
Options.append(['Rotate time?', WindowsInputTypes.Integer, 100])
Values = Win.OptionsDialog('Rotation setting', Options)

Rotation = Values[0]
Speed = Values[1]
Time = Values[2]

ca = CurrentAssembly()
for i in range(len(ca.Parameters)):
if ca.Parameters.Name == Rotation:
M = i
Posi_x = ca.Parameters[M].Value
for r in range(Time):
Posi_x = Posi_x + Speed
ca.Parameters[M].Value = Posi_x
 

MCATI

Member
Very nice, questoins:
1- ca.Parameters[M].value, where can find the description of this command in Alibre website
2- ca.Parameters.Name == Rotation; where can find this command in Alibre website

I feel Alibre company's script explanations/help are very bad organized or explained.
 

Suppakit

Member
Very nice, questoins:
1- ca.Parameters[M].value, where can find the description of this command in Alibre website
2- ca.Parameters.Name == Rotation; where can find this command in Alibre website

I feel Alibre company's script explanations/help are very bad organized or explained.
Hi,
Answer 1: you can define ca.Parameters[M].value to whatever variable for example "YourDefind1.Parameters[YourDefind2].value"
Answer 2: ca.Parameters. Name is defined as the name of all constrain such as "A =angle", "D =distant" and "S =scale" that you can see in equation editor(FX)
every knowledge, you must try by yourself that not show in Alibre help for deep detail (actually my teacher is Chat GPT LOL:rolleyes:)
1683179709933.png


I think this forum is the treasure for everyone who needs to make Alibre more powerful.
If you have any questions don't hesitate to ask me or any expert here, I am just the beginning user indeed.
 
Top