(command "explode" ?
The following lisp routine is bugged in some way by the inclusion of "explode" and rets the error msg "User defined lisp functions cannot be transparent". I have tried coding the explode functionality in various ways with mixed results, sometimes w/ the message above and sometimes w/ "function cancelled", and in some forms it seems to work despite what could be interpreted as error msgs. When the lisp listener get to the point of responding w/ "User defined lisp functions cannot be transparent", it is usual, although not always, that the fix is to exit & restart icad.(defun c:drawface (/ pt1 pt2 pt3)(setvar "pfacevmax" 3)(setq pt1 nil pt2 nil pt3 nil)(while (= pt1 nil) (setq pt1 (getpoint "pick 1st point")))(while (= pt2 nil) (setq pt2 (getpoint "\npick 2nd point")))(while (= pt3 nil) (setq pt3 (getpoint "\npick 3rd point")))(command "face" pt1 pt2 pt3 """")(command "selgrips" "pro" "ty" "3dface" "" "explode" """")(princ))Any comments, suggestions, or otherwise generally useful knowledge? Thanks
Comments
-
If your intent is to create a 3D Face and then immediatelyexplode it into line vectors, then this modified version ofyour code works. It seems that the '(command "selgrips....'breaks somewhere.(defun c:drawface (/ pt1 pt2 pt3)(setvar "pfacevmax" 3)(setq pt1 nil pt2 nil pt3 nil)(while (= pt1 nil) (setq pt1 (getpoint "pick 1st point")))(while (= pt2 nil) (setq pt2 (getpoint "\npick 2nd point")))(while (= pt3 nil) (setq pt3 (getpoint "\npick 3rd point")))(command "face" pt1 pt2 pt3 """")(command "explode" "last")(princ))
0 -
(command "explode" "last") appears to work in this case, however, I have recently found other cases in which it doesn't for reasons unknown. If the prompted "L", by way of icad prompt box, is used for "last", the code still works in this case, but in other cases, "L" starts the line command from (command "explode" "L").Aside from this, there should be some consistency in how area, length, and perimeter are used and calculated and stored for 2dpolylines or 3dpolylines either open or closed. The plan area of a 3dpolyline can be as useful as for a 2dpolyline, w/ the understanding that area of a closed 3dpoly should compute as a plan-view projection; a distinction of length (open polyline) vs perimeter (closed polyline) exists but hasn't been finished to include both 2d and 3d polylines.
0 -
To follow up and put this topic to rest; it seems that assigning (entlast) to a variable and then using that variable as an argument to (command "explode", as in the following code, will work consistently where other forms may or may not. ;;;3dpolyline and close; "area" rets area and perimeter.(defun c:dr3dplc ()(initget 128)(setq ptlist '() cont 1)(while (= cont 1) (setq pt (getpoint "\npick point or enter"))(if (/= pt nil) (setq ptlist (cons pt ptlist)) (setq cont nil)))(command "3dpoly" ptlist "close")(command "area" ptlist "")(setq ent (entlast))(command "explode" ent)(princ))The issues regarding the way area and perimeter/length are stored still remains if they are to be more useful (see previous forum topic (getpoint) ; a similar issue).Thanks for the feedback. Regards mk
0