Skip to main content

Translating a SOLIDWORKS CAD model to AnyBody

Contents

Translating a SOLIDWORKS CAD model to AnyBody#

Start by downloading the example SOLIDWORKS CAD assembly

After having downloaded and opened this model in your SOLIDWORKS environment, you will see the following image.

SolidWorks fitnessmachine

As you can see, this SOLIDWORKS assembly contains several parts and mates. The assembly has three different configurations, each managing different sets of mates. We will discuss the purpose of these different configuration settings later.

The role of the mates in this model is as follows. The ‘MainBase’ part should be fixed to the global origin. And the other parts should be connected to this base and each other by the mates. The total number of DOF (degrees-of-freedom) of this model should be one.

Let us try to translate this model into a corresponding AnyScript model. If you have registered the AnyBody Exporter™ for SOLIDWORKS® (AnyExp4SOLIDWORKS™) add-in successfully, then you will see the menu of the AnyExp4SOLIDWORKS add-in on the SOLIDWORKS menu like this:

AnyExp4SOLIDWORKS menu

Start the translation process by selecting the ‘Export to AnyScript’ menu item. Doing this will display the following dialog.

AnyExp4SOLIDWORKS dialog

In this dialog you can choose various options for the translation process such as indentation method, constraint type for mates, STL file type and so on. If you press the OK button after having decided the options you want to use, you will see a file dialog asking you to choose where your files will be saved. For this tutorial we shall use the default options settings. You can change the location and the file name to be what you want for this example.

Save as dialog

If you look at the folder where you saved your own files, then you will see that there are two AnyScript files (FitnessMachine.any and FitnessMachine.main.any) and several STL files.

Let’s try to open the ‘FitnessMachine.main.any’ file using the AnyBody Modeling System. It should look like this:

...
// This AnyScript file was automatically generated by the AnyExp4SOLIDWORKS translator add-in.
// Translation date: Wed Oct 17 14:09:24 2012
// AnyExp4SOLIDWORKS Version: 1.0.0
Main =
{
  #include "FitnessMachine.any"
};

This ‘FitnessMachine.main.any’ file just includes the ‘FitnessMachine.any’ file. When you load it, you will see that several ANYSURF3 files are created from the STL files.

Model View Fitness machine

After loading this file, we should check which properties of the SOLIDWORKS assembly could be translated into AnyScript. These properties are:

  • The SOLIDWORKS assembly model structure

  • The part information (mass property, initial position, STL geometry file, color)

  • Mate information between the different parts in the assemblies

SOLIDWORKS assembly model structure #

Let us compare the SOLIDWORKS Feature Tree and the AnyBody Model Tree.

SOLIDWORKS properties ANYBODY model tree

First, the top assembly ‘FitnessMachine’ is converted into a corresponding AnyFolder object, which has the same name. All individual parts are converted into corresponding AnySeg objects. Some reference entities such as origin and planes are converted into AnyFixedRefFrame or AnyRefNode objects depending on whether they are fixed or attached to movable parts. Finally, there is an AnyFolder object named ‘Mates’, which contains all converted mate information.

Part information (mass property, initial position and STL geometry file) #

If you look at the information about the ‘Main.FitnessMachine.MainBase___1’ AnySeg object, you will see the following piece of code.

AnySeg MainBase___1 =
{
  r0 = {-0.1, 0.55, -8.455958313e-005};
  Axes0={ {1, 0, 0}, {0, 1, 0}, {0, 0, 1} };
  Mass = 73.1179928;
  Jii = {6.221732725, 13.35441288, 17.11071671};
  Jij = {0.5751545834, -0.0006960674174, -0.0005824144636};
  sCoM = {-0.189906896, -0.04988090848, 1.942340762e-005};
  JaboutCoMOnOff = On;
  AnyDrawSurf drw =
  {
    FileName = "FitnessMachine.MainCylinder_cfg0_9c1185a5c5e9fc546128.stl";
    Opacity = 1;
    RGB = {0.9098039216, 0.4431372549, 0.03137254902};
    AnyStyleDrawMaterial1 style =
    {
      EnableCreasing = On;
      CreasingAngle = 0.524;
    };
  };
  AnyRefNode Origin =
  {
    sRel = {0, 0, 0};
    ARel={ {1, 0, 0}, {0, 1, 0}, {0, 0, 1} };
  };
  ...

As you can see here, mass properties, initial position & rotation and geometry information (STL file) were translated into AnyScript.

Mate information #

Generally, all mate information in a CAD assembly model can be regarded as kinematic constraints. Based on these constraints, you can move the assembly models inside the CAD system. All these mate objects are translated into corresponding kinematics constraints in AnyScript, such as AnyKinEq, AnyKinEqSimpleDriver or some standard joint types like AnyRevoluteJoint, AnySphericalJoint..

Let us select one mate in the assembly and look at it in detail inside SOLIDWORKS.

SolidWorks assembly

The ‘Concentric11’ mate was established between MainCylinder-1 and BeamType1-2 components. In the above picture, the selected violet cylinder is included in the MainCylinder-1 component, and the selected orange point is included in the BeamType1-2 component. So this mate is the concentric mate between a point and a cylinder. This means that the orange point (on BeamType1<2> component) can translate and rotate on the axis of this violet cylinder (on MainCylinder<1>). So this mate can be translated into two linear constraints in the corresponding AnyScript model.

The AnyScript code for the Concentric11 mate is as follows:

AnyKinEqSimpleDriver Concentric11 =
{
  AnyKinLinear lin =
  {
    AnyRefFrame& base = ...MainCylinder___1.FitnessMachine_Concentric11;
    AnyRefFrame& target = ...BeamType1___2.FitnessMachine_Concentric11;
    Ref = 0;
  };
  MeasureOrganizer = {0, 1};
  DriverPos = {0, 0};
  DriverVel = {0, 0};
  CType = {.._ANY_CTYPE_, .._ANY_CTYPE_};
};

Where we notice that the ‘MeasureOrganizer’ selects two of the three translational measurement defined by the AnyKinLinear object. The following picture shows the relationship between these two components.

SolidWorks Two components

Here you can see that the AnyKinLinear kinematic measure, which is defined between the ‘FitnessMachine_Concentric11’ AnyRefNode object of the ‘BeamType1___2’ AnySeg object (dark orange color) and the ‘FitnessMachine_Concentric11’ AnyRefNode object of the ‘MainCylinder___1’ AnySeg object (cyan color), should have its x and y coordinates as zero position and velocity values. The AnyRefNode objects called ‘FitnessMachine_Concentric11’ on both AnySeg objects were created automatically by the translation process for the sole purpose of creating these constraints.

Finally notice that the ‘Reaction.Type’ of these constraints is ‘On’ as default, since it has not been set by the translator. This implies that reaction forces associated with the constraints are indeed active. Also notice the constraint type (‘CType’), which is set to parametric value, ‘_ANY_CTYPE_’, defined by the translator. The parameter, ‘_ANY_CTYPE_’, can later be modified in the AnyScript model, or by a new translation of the model.

With this we will conclude our brief review of the translated model and now let us go to the next Lesson2.

装修网房屋装修设计风格精装修房子怎么装修聘用装修监理半包家装装修分那几种工业简装风格怀化简装室内全屋定制装修小女孩生日房间装饰时代风装饰公司怎么样家里简装要花多少钱扬州公装设计黄山装修毛坯房简装大概多少钱一平米池州金鼎装饰公司包头市的装修公司本地好的家装公司大庆圆方装饰公司小房子精装修幼儿园园区装修家装,公装,装饰设计简装现代芜湖精装修辽宁装饰装修100平装修50万什么档次精装修地产无锡装修网站壁布装修一般多少钱店铺装修网站大全杭州简装香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声汪小菲曝离婚始末卫健委通报少年有偿捐血浆16次猝死单亲妈妈陷入热恋 14岁儿子报警雅江山火三名扑火人员牺牲系谣言手机成瘾是影响睡眠质量重要因素男子被猫抓伤后确诊“猫抓病”中国拥有亿元资产的家庭达13.3万户高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了男孩8年未见母亲被告知被遗忘张家界的山上“长”满了韩国人?倪萍分享减重40斤方法许家印被限制高消费网友洛杉矶偶遇贾玲何赛飞追着代拍打小米汽车超级工厂正式揭幕男子被流浪猫绊倒 投喂者赔24万沉迷短剧的人就像掉进了杀猪盘特朗普无法缴纳4.54亿美元罚金周杰伦一审败诉网易杨倩无缘巴黎奥运专访95后高颜值猪保姆德国打算提及普京时仅用姓名西双版纳热带植物园回应蜉蝣大爆发七年后宇文玥被薅头发捞上岸房客欠租失踪 房东直发愁“重生之我在北大当嫡校长”校方回应护栏损坏小学生课间坠楼当地回应沈阳致3死车祸车主疑毒驾事业单位女子向同事水杯投不明物质路边卖淀粉肠阿姨主动出示声明书黑马情侣提车了奥巴马现身唐宁街 黑色着装引猜测老人退休金被冒领16年 金额超20万张立群任西安交通大学校长王树国卸任西安交大校长 师生送别西藏招商引资投资者子女可当地高考胖东来员工每周单休无小长假兔狲“狲大娘”因病死亡外国人感慨凌晨的中国很安全恒大被罚41.75亿到底怎么缴考生莫言也上北大硕士复试名单了专家建议不必谈骨泥色变“开封王婆”爆火:促成四五十对测试车高速逃费 小米:已补缴天水麻辣烫把捣辣椒大爷累坏了

装修网 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化