DesignModeler Scripting: Direction vector in extrude command
1 Attachment(s)
I want to extrude a surface body in global x direction by Designmodeler scripting. Unfortunately, the direction vector cannot be specified in the API-command:
Designmodeler Users' Guide: Extrude(Operation, BaseObject, Direction, Extent, Depth, Extent2, Depth2, Walled, Thin1, Thin2) However, in Designmodeler's GUI it's very easy to specify the direction vector: Attachment 40241 Does anyone know how to solve this problem? Best regards Tobias |
Hi Tobias,
I have never used it but you can give this a try. After defining Extrude and before Regenration you mite have to add the below code. But before you could do use that, you have to named select the 2D edge ("EDGE1") you want to use to call it in script. Code:
ag.listview.ActivateItem("Direction Vector"); Code:
Code:
var EDGE1 = ag.m.ModelEdges(1); //you have to find out what number edge you want as your 2D edge Hope it helps Cheers KAPI |
Dear Kapi,
thank you for this solution. I found out that it's also possible to set the direction vector by the command extrude_obj.SetDirection(x,y,z). #### Code example ##### var ext1 = agb.Extrude(agc.Add, ps1.Sk1, agc.DirNormal, agc.ExtentFixed, 3.5, agc.ExtentFixed, 0.0, agc.No, 0.0, 0.0); ext1.SetDirection(0.5,0.5,0.5); agb.Regen(); //To insure model validity ###################### Best regards Tobias |
Thanks Tobias_H,
we learn new things everyday! Cheers KAPI |
All times are GMT -4. The time now is 04:18. |