3D Design

3D Design

Tagged: 

    • Elzubeir
      Subscriber
      I have generated a box of ellipsoidal particles by DEM, and I got the positions in (x, y, z) and orientations for every single ellipse in the Excel sheet. I need to reconstruct these particles in SpaceClaim by modelling one ellipse and copy it to the new positions with different orientations. My question is how can I read data that is recorded in my Excel into the script then I can run the code?.
    • Keyur Kanade
      Ansys Employee
      Can you please explain more. As I understand you have xyz for each particle. Now you want to create ellipse for each particle in SpaceClaim?nWhy do you want to create particles in SpacClaim? You can define them in Fluent. nIn SpacClaim please check pattern command. nPlease go through help manual for more details nRegards,nKeyurnHow to access Ansys Online Help DocumentnHow to show full resolution imagenGuidelines on the Student CommunitynHow to use Google to search within Ansys Student Communityn
    • Elzubeir
      Subscriber
      Thanks,nYes I want to model a box of particles in order to simulate it in Fluent. A you see below, this particles I got from DEM therefore I have xyz for each particle and orientation in Excel sheet. I wrote a code in the script to model a master particle in order to copy it to new position. Due to huge number of particles I ask for a way or function to used excel sheet data as input. I hope you got my point!nRegardnElzubeirnnn
    • Keyur Kanade
      Ansys Employee
      You may want to explore python for scripting in SpaceClaim. nAlso you can import txt in SpaceClaim as following. nIn SCDM, we can open a text file (*.txt) containing the points coordinates of curves. It will generate automatically the curves.nFrom the menu File > Open, select All Files filter and select a .txt file.nnThe syntax in the file for 2D curves is the following:nnpolyline=falsen1 1.5 2.0n1 1.0 3.2n1 0.5 2.1n2 0.3 4.2n2 4.8 1.9nnThe first column contains the number (ID) of the generated line, the second column the x-coordinate and the third column the y-coordinate.nnThe file format for 3D curve is the following:nnpolyline=falsen3d=truen0 0 1n0 1.5 1.2n1.5 0 2.3n1 1.5 4.2nn1.5 1.2 5.1n2.3 4.2 6.2n5.7 3.1 2.6nnWith the option 3d=true, the different curves are delimited by a linebreak. The first column contains the z-coordinate, the second column the x-coordinate and the third column the y-coordinate of the points.n
    • Elzubeir
      Subscriber
      After I modeled the master particle, I have wrote this code to copy it to other position (x,y,z). The issue is I am looking for a function to read these values from text or excel file as input to be changed till end of the columns nthe codenresult = Copy.ToClipboard(Selection.Create(GetRootPart().Bodies[master particle]))nresult = Paste.FromClipboard()nselection = Selection.Create(GetRootPart().Bodies[1])noptions = MoveOptions() nmoveType = TransformType.RotateX nresult = Move.Execute(selection, globalSystem, moveType, DEG(value1), options) nselection = Selection.Create(GetRootPart().Bodies[1])nmoveType = TransformType.RotateZ nresult = Move.Execute(selection, globalSystem, moveType, DEG(value 2), options) nselection = Selection.Create(GetRootPart().Bodies[1])noptions = MoveOptions() nmoveType = TransformType.TranslateX nresult = Move.Execute(selection, globalSystem, moveType, MM(value 3), options) nselection = Selection.Create(GetRootPart().Bodies[1])noptions = MoveOptions() nmoveType = TransformType.TranslateY nresult = Move.Execute(selection, globalSystem, moveType, MM(value 4), options) nselection = Selection.Create(GetRootPart().Bodies[1])noptions = MoveOptions() nmoveType = TransformType.TranslateZ nresult = Move.Execute(selection, globalSystem, moveType, MM(value 5), options) nresult = Copy.ToClipboard(Selection.Create(GetRootPart().Bodies[master particle]))nresult = Paste.FromClipboard()Thanksn
Viewing 4 reply threads
  • You must be logged in to reply to this topic.