[Ca...] Posted April 28, 2022 Share Posted April 28, 2022 Hallo, I’m looking for a PCM solution to change the Orientation of the Model? I have the Problem that I have to check several Models with always the same program. Problem: The orientation is always not like in the measurement program and I cant get it fixed from our design. Is there perhaps a way, to place a PCM in the background which starts as soon as a model is loaded and orientate it automatically in hardcoded values X=xx , Y=xx, Z=xx, Rotation and so on. Or is there perhaps a way to like to the Names of Planes or Circles? F.e. when I extract on the part a Plane which is called “A” then the Part moves in this fixed value to 0. Yes, this sounds perhaps very theoretically and I’m really not sure if there is an solution for this. But perhaps the one or the other has an good idea how to do it in a better way then manual. Thanks in advance, Link to comment Share on other sites More sharing options...
[Ch...] Posted April 28, 2022 Share Posted April 28, 2022 There is a way to clear and load CAD files with PCM, however rotating translating them with PMC - I dont think so - unless you write external code to the ACIS engine .. How many different orientation do you think you might need? If it is a set # like 10 for example, you can simply save 10 different models, and have PCM load the right one depending on operator selection, or measurement result, etc. Theoretically you do this for any unlimited number, but would obviously be very time consuming. There is a good post in the forums by user Derek Stedman with an example how to do this, I cat seem to find it a the moment. Something similar to this ... // Find current inspection directory planpath = getActualInspectionDir() // Cad Model Folder modelpath = planpath + "\CAD\" // Make VARs to link to models SIDE1 = modelpath + "ZX4638_SIDE_01.sat" SIDE2 = modelpath + "ZX4638_SIDE_02.sat" // make sure the left model is loaded at program start // to make sure this actually happens before the user does anything // also put it in inspection_post_load_pcm.txt clearCAD() loadCADFile(SIDE1) Good luck! Link to comment Share on other sites More sharing options...
[Er...] Posted April 29, 2022 Share Posted April 29, 2022 Please sign in to view this quote. moveCADModel(x,y,z) rotateCADModel(deg[,0,1,2]) //0 or nothing = Z, 1 = X, 2 = Y Link to comment Share on other sites More sharing options...
[Ca...] Posted April 29, 2022 Author Share Posted April 29, 2022 @Eric Moberg, this looks really promising, but i get always on the rotation an error message that an "bracket" would be missing and i dont found out why.. Please sign in to view this quote. I did it like that.. 🙂 @Chris Rotolo Thanks for your code, i will keep it in mind, but in my case its not the correct solution. 🙂 but already good to load them. Link to comment Share on other sites More sharing options...
[Ma...] Posted April 29, 2022 Share Posted April 29, 2022 Perhaps it is that comma in square bracket before first number Link to comment Share on other sites More sharing options...
[Re...] Posted April 29, 2022 Share Posted April 29, 2022 Hello, rotateCADModel(90[0]) // will rotate 90° around Z rotateCADModel(90[1]) // will rotate 90° around X rotateCADModel(90[2]) // will rotate 90° around Y Link to comment Share on other sites More sharing options...
[Er...] Posted May 2, 2022 Share Posted May 2, 2022 Please sign in to view this quote. No, format of the argumet to pass is: deg[,0] So to mimic your example with 90° rotation around Z, X and Y in that order: rotateCADModel(90) //rotateCADModel(90,0) also works. rotateCADModel(90,1) //Rotate about X rotateCADModel(90,2) //Rotate about Y (Square brackets is to show that something is optional) Link to comment Share on other sites More sharing options...
[Zo...] Posted May 9, 2022 Share Posted May 9, 2022 I just read this post and I am intrigued to use it. I have many similar situations, where I have a template for a part family, but I have to import parts and orient them manually. re-orientation is always the same in my case, but I have another issue that I hope you guys can help [list=1]first and foremost, when I Load the model, I have to CAD > Modification > Delete free lines and points is there any code for that? I also have a fixture in my template and parts are two pieces. I usually: [list=]CAD > CAD File > Load... [list=]CAD > Modification > Delete free lines and points [list=]CAD > Modify Cad entity... [list=]Transformation Tab [list=]select model that needs to rotate/move now if i want to use "rotateCADModel(90[1])" somehow i have to isolate this one solid from the rest so my question is [list=1]how to delete free lines and point How to move/rotate individual solids2.jpg3.jpg4.jpg5.jpg6.jpg7.jpg Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in