Jump to content

Recommended Posts

Posted

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

Posted

Try this:

 

(vl-load-com)
(vla-SendCommand
   (vla-get-ActiveDocument (vlax-get-acad-object))
   (strcat "MESHSMOOTH" " " "(ssget \"X\" '((0 . \"3dsolid\")))" " " " ")
)

Posted

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.

Posted

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

Posted (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 by GP_
Posted
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

Posted (edited)

Hi Henrique,

 

in my AC2014 the OP's code works only with primitive solids.

Edited by GP_
Posted
Hy Henrique,

 

in my AC2014 the OP's code works only with primitive solids.

 

Gian Paolo,

 

I did only tested with primitive solids... :oops:

 

In AC2014 and without primitive solids, only with the vla-SendCommand as you had suggested, worked ok.

 

Cheers

Henrique

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...