yes, you are right!
I changed my code and now it support any conditions:
;;replaces NewStr instead of Patt(s) in Str string (defun ReplaceStr (NewStr Patt Str / pos) (setq pos 0) (While (setq pos (vl-string-search patt str pos)) (setq Str (vl-string-subst NewStr patt Str pos)) (setq pos (+ pos (strlen NewStr))) ) str ) ;;usage ;;(ReplaceStr "AAA" "A" "A-A-A")
there is no any exceptional situation to freeze autocad!
It can still be streamlined a bit, no need for the initial (setq pos 0) as being pos = nil it will use the default position 0.
;;replaces NewStr instead of Patt(s) in Str string (defun ReplaceStr (NewStr Patt Str / pos) ;;; (setq pos 0) this can be omitted (While (setq pos (vl-string-search patt str pos)) (setq Str (vl-string-subst NewStr patt Str pos)) (setq pos (+ pos (strlen NewStr))) ) str ) ;;usage ;;(ReplaceStr "AAA" "A" "A-A-A")Reinaldo
You could make a lisp program that reads the PFACE vertices and use the data to entmake a new MESH object like the ones shown in the video. This can be done using the programs included in the class handout and dataset. But this can be also done using commands:
You should convert the Polyface Mesh into a new MESH object before. It must be a "watertight" MESH, that means it should enclose a volume, no holes in it. To do this use the _MESHOPTIONS command selecting the appropriate options. For example see the attached image. You must select the Polyface mesh using the button on the upper left corner, of the dialog, select the appropriate mesh type. In the case shown in the image, as the faces are triangular, I'll select Triangle. For maximum angle between new faces I'll select 180 degrees so no new faces are added. I cam prewiew the resulting mesh using the Preview button. If the resulting mesh is what I am looking for, ENTER will make the transformation.
Once the PFACE mesh is converted to a new MESH object I can use the _CONVTOSOLID command to create the new 3DSolid entity. If the mesh is not watertight you can try the _THICKEN command that will create a solid slab with the specified thickness. You can see examples of this in my videos.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.