raymarcher Posted October 30, 2014 Share Posted October 30, 2014 I made some scripts to work with solids. The first three work but the third to turn a solid into a mesh with meshsnmooth does not work. Can somebody help? SOLIDS ERASE ( (setvar "qaflags" 1) (setq SolidsErase (ssget "X" '((0 . "3dsolid")))) (command "ERASE" SolidsErase "") (setvar "qaflags" 0) ) SOLIDS OFFSET BASE POINT ( (setvar "qaflags" 1) (setq SolidsOffset (ssget "X" '((0 . "3dsolid")))) (command "MOVE" SolidsOffset "" "0,0,0" "5,5,0") (setvar "qaflags" 0) ) SOLIDS OFFSET DISPLACEMENT ( (setvar "qaflags" 1) (setq SolidsOffset (ssget "X" '((0 . "3dsolid")))) (command "MOVE" SolidsOffset "" "" "2,2,2") (setvar "qaflags" 0) ) SOLIDS TO MESH ( (setq SolidsToMesh (ssget "X" '((0 . "3dsolid")))) (command "MESHSMOOTH" SolidsToMesh "") ) Thanks a lot Quote Link to comment Share on other sites More sharing options...
GP_ Posted October 30, 2014 Share Posted October 30, 2014 Try this: (vl-load-com) (vla-SendCommand (vla-get-ActiveDocument (vlax-get-acad-object)) (strcat "MESHSMOOTH" " " "(ssget \"X\" '((0 . \"3dsolid\")))" " " " ") ) Quote Link to comment Share on other sites More sharing options...
raymarcher Posted October 31, 2014 Author Share Posted October 31, 2014 Thanks, I will let you know if it works. Is it necessairy ti use visual lisp? I wanted to keep things simple in an autolisp. Quote Link to comment Share on other sites More sharing options...
hmsilva Posted October 31, 2014 Share Posted October 31, 2014 Is it necessairy ti use visual lisp? I wanted to keep things simple in an autolisp. On this side (tested only in AutoCAD 2010), the (setq SolidsToMesh (ssget "X" '((0 . "3dsolid")))) (command "MESHSMOOTH" SolidsToMesh "") Works as expected. Henrique Quote Link to comment Share on other sites More sharing options...
GP_ Posted November 1, 2014 Share Posted November 1, 2014 (edited) (setq SolidsToMesh (ssget "X" '((0 . "3dsolid")))) (command "MESHSMOOTH" SolidsToMesh "") (setq SolidsToMesh (ssget "X" '((0 . "3dsolid")))) (command "MESHSMOOTH" SolidsToMesh "") Henrique, the code is the same. It doesn't works on my A2014. Edited November 2, 2014 by GP_ Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 1, 2014 Share Posted November 1, 2014 Henrique, the code is the same. It doesn't work on my A2014. Hi GP, I know that the code is the same, I was just saying to OP that is code worked as expected in AC2010... After your reply, I did test the OP code in another machine with AC2012 and AC2014, and work ok in all versions... Henrique Quote Link to comment Share on other sites More sharing options...
GP_ Posted November 1, 2014 Share Posted November 1, 2014 (edited) Hi Henrique, in my AC2014 the OP's code works only with primitive solids. Edited November 1, 2014 by GP_ Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 1, 2014 Share Posted November 1, 2014 Hy Henrique, in my AC2014 the OP's code works only with primitive solids. Gian Paolo, I did only tested with primitive solids... In AC2014 and without primitive solids, only with the vla-SendCommand as you had suggested, worked ok. Cheers Henrique Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.