rw1962 Posted October 2, 2023 Posted October 2, 2023 (edited) I use Bricscad 2022, and I am customizing a LISP routine to use 3dpoly's for breaklines and boundary limit for TIN selections. The code is as follows: ;;------------------------------------------------------------------; ;; wpl, List of Points List, Closed Constraints (Closed Polylines) ; ;; pl, List of Points (3D) ; ;; cdtl, List of Points (3d) Forming Constraints ; ;; nfl, List of Points in Constraint That Are Not in pl ; ;; ssb , Selection Set of Constraints... polyline ; ;;------------------------------------------------------------------; ((= etyp "POLYLINE") (setq pol (listpol en) a (pos2d (car pol) pl fuzz) b (pos2d (cadr pol) pl fuzz) ) (if (and a b) (setq cdtl (cons (list a b) cdtl)) (setq nfl (cons (list a b) nfl)) ) (foreach p (cdr pol) (if (setq b (pos2d p pl fuzz)) (setq cdtl (cons (list (cadar cdtl) b) cdtl)) (setq nfl (cons (list (cadar nfl) a) nfl)) ) ) (if (and (equal (car pol) (last pol) 0.001) (> (length pol) 2) (not (ssget "_WP" (cdr pol) '((0 . "POINT")))) (not (vl-position pol wpl)) ) (setq wpl (cons pol wpl) ent (entmod (subst (cons 8 lay) (assoc 8 ent) ent)) ) ) ) ;; end etyp polyline It crashes on the last line with (assoc 8 ent): (setq wpl (cons pol wpl) ent (entmod (subst (cons 8 lay) (assoc 8 ent) ent)) ) I can't find any information about this difference between a standard Polyline and a 3dpoly. Which is odd, since a 3dpoly appears to be a polyline with elevations. Edited October 2, 2023 by rw1962 bad phrasing Quote
BIGAL Posted October 3, 2023 Posted October 3, 2023 This is part code so is lay being set, and is ent = Entget entity. Quote
rw1962 Posted October 3, 2023 Author Posted October 3, 2023 Thanks, but is it proper code for a 3dpolyline? It is indicated as a point of error by the LISP driver. If it is proper, then it is apparently loaded with wrong data, and I will have to review all of the variables that contribute to this execution. Quote
BIGAL Posted October 3, 2023 Posted October 3, 2023 Trying to understand, does 3d poly exist or are you trying to make a new one ? Did you use ChatGP to make code ? Look into Civil Site Design works with Bricscad and has the functions your looking for, plus much more to do with TIN's. Try this not tested. (defun Polyline (lst) (entmakex (list (cons 0 "POLYLINE") (cons 10 '(0 0 0)))) (mapcar (function (lambda (p) (entmake (list (cons 0 "VERTEX") (cons 10 p))))) lst) (entmakex (list (cons 0 "SEQEND"))) ) Quote
rw1962 Posted October 4, 2023 Author Posted October 4, 2023 (edited) The code is part of a condition case... (COND ((= etyp "POLYLINE")) ... and it has picked up a 3d polyline from the drawing. It crashes on (setq wpl (cons pol wpl) ent (entmod (subst (cons 8 lay) (assoc 8 ent) ent))). The reason I say that, is that the LISP driver says that it has happened there. However, I think that it is proper code, but I can't find any documentation that is specific to a 3d polyline to prove it. It appears to me that a 3d poly is a 2d poly that has one unique DXF setting, the 70 parameter: '( 70 . 8 ) if it is an open 3d polyline -or- '( 70 . 9 ) if it is a closed one. Since I am trying to rule out that my current code is wrong (I don't think that it is), I am asking if anyone is aware of a different coding that is also specific to a 3d polyline. In my opinion I believe that additional coding in my overall procedure (not shown) has been corrupted (somehow) and is generating erratic error signals. Which is a tough situation to track down. So even though I think the coding is correct (as what I have posted), I am trying to see if it is actually wrong (because 3d polylines do not appear to be clearly documented). Maybe they are perfectly documented, but they are not specified in any documentation as being only different (2d polyline / 3d polyline) by the '( 70 . 8 ) or '( 70 . 9 ) parameters (plus that a 3d polyline has elevation vertices). ... and yes, this is a 3d face application, but I don't think that is relevant to what I am asking. Edited October 4, 2023 by rw1962 Quote
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.