Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/25/2023 in all areas

  1. This was an example, I thought it was simple for you to interpret this one and modify it accordingly. Without knowing your lisps, then maybe like this? (defun c:FOO ( / ) (if (not (c:xx)) (load "xx.lsp")) (if (not (c:yy)) (load "yy.lsp")) (mapcar '(lambda (x) (cond ((and (not (zerop (atoi x))) (eq (atof x) (atoi x))) (if (zerop (rem (atoi x) 2)) (c:xx) (c:yy) ) ) (T (princ (strcat "\nThe layout \"" x "\" have not name with interger or is null"))) ) ) (layoutlist) ) (textscr) (prin1) )
    1 point
  2. Great Video. There is a CAD Sketcher Add-on, it may make exact extrudes easier, I need to try some CAD on Blender when time allows. The old way of exact extrudes was to place a vertex and move it the exact distance then extrude to the vertex.
    1 point
  3. Try this ! (defun c:FOO ( / ) (mapcar '(lambda (x) (cond ((and (not (zerop (atoi x))) (eq (atof x) (atoi x))) (if (zerop (rem (atoi x) 2)) (princ (strcat "\n\"" x "\" is even (run your \"xx.lsp\")")) (princ (strcat "\n\"" x "\" is odd (run your \"yy.lsp\")")) ) ) (T (princ (strcat "\nThe layout \"" x "\" have not name with interger or is null"))) ) ) (layoutlist) ) (textscr) (prin1) )
    1 point
  4. (defun c:FOO ( / ll cl ) ; command is FOO (setq ll (layoutlist)) ; save layoutlist to ll list. (repeat (length ll) ; repeat as many time as number of members in the list ll. (setq cl (car ll)) ; get the first member of the list ll. (setvar 'ctab cl) ; set the current layout with cl. (if (= (len (atoi cl)) (len (itoa (atoi cl)))) ; check if the layout string is numeric. (progn ; if numeric (cond ; cond for determining odd even ((= (rem (atoi cl) 2) 0) ; if even (xx) ; run xx, if xx.lsp's command is xx and already loaded ) ; end of even ((= (rem (atoi cl) 2) 1) ; if odd (yy) ; run yy, if yy.lsp's command is yy and already loaded ) ; end of odd ) ; end of cond ) ; end of if numeric progn (progn ; if layout name is not numeric ) ; end of if not numeric progn ) ; end of if (setq ll (cdr ll)) ; Remove the first member of the list to move on to the next layout. ) ; end of repeat (princ) ; for mute parrot ) ; end of defun ================= Steven gave a nice comment. Adding this would also be a way. (vl-load-com) (defun len ( txt / ) (strlen (vl-princ-to-string txt)) )
    1 point
  5. I finally got around to finishing the video tutorial for this. It was quite a learning experience, since it's the first time I've created a video with audio, but I think it turned out pretty good. Hope it helps.
    1 point
  6. @3dwannab Hi. here is a lisp that do the same as Profile 3D Polyline command, that for me works better... aridzv. long_section_3dp.lsp
    1 point
  7. @devitg I took over the code to be able to make requests (in a loop) from lines located in the East, North and West. But I changed the type from XLINE to RAY which leaves the reading clearer. If it can help you... (defun find_inter (obj tmp_obj mod / vrt_pt pt lst_pt) (setq vrt_pt (vlax-variant-value (vla-IntersectWith obj tmp_obj mod))) (if (>= (vlax-safearray-get-u-bound vrt_pt 1) 0) (progn (setq pt (vlax-safearray->list vrt_pt)) (if pt (if (> (length pt) 3) (repeat (/ (length pt) 3) (setq lst_pt (cons (list (car pt) (cadr pt) (caddr pt)) lst_pt) pt (cdddr pt)) ) (setq lst_pt (cons pt lst_pt)) ) ) ) ) (if (and lst_pt (listp lst_pt)) lst_pt ) ) (defun C:3dwannab ( / ss n ent lst_pt ss_base dxf_ent pt_base dlt pt_tmp ang dxf_11 new_ent l_pt nw_lst) (princ "\nSelect polylines.") (setq ss (ssget '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) (cond (ss (repeat (setq n (sslength ss)) (setq ent (ssname ss (setq n (1- n))) lst_pt (append (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget ent))) lst_pt) ) ) (princ "\nSelect the reference line.") (while (setq ss_base (ssget "_+.:E:S" '((0 . "LINE")))) (setq dxf_ent (entget (ssname ss_base 0)) pt_base (list (cdr (assoc 10 dxf_ent)) (cdr (assoc 11 dxf_ent))) dlt (distance (car pt_base) (cadr pt_base)) ) (foreach a (list 0 (* 0.5 pi) pi (* 1.5 pi)) (setq pt_tmp (inters (car pt_base) (cadr pt_base) (car lst_pt) (polar (car lst_pt) a dlt) T)) (if pt_tmp (setq ang a pt_tmp nil)) ) (cond (ang (setq dxf_11 (cond ((zerop ang) '(11 1.0 0.0 0.0)) ((eq ang (* 0.5 pi)) '(11 0.0 1.0 0.0)) ((eq ang pi) '(11 -1.0 0.0 0.0)) (T '(11 0.0 -1.0 0.0)) ) ) (foreach pt lst_pt (setq pt_tmp (inters (car pt_base) (cadr pt_base) pt (polar pt ang dlt))) (cond ((and pt_tmp (eq (sslength (ssget "_F" (list pt pt_tmp) '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) 1)) (repeat (setq n (sslength ss)) (entmakex (list '(0 . "LINE") '(100 . "AcDbXline") (cons 10 pt) (cons 11 pt_tmp))) (setq new_ent (entlast) ent (ssname ss (setq n (1- n))) l_pt (find_inter (vlax-ename->vla-object ent) (vlax-ename->vla-object new_ent) acExtendNone) ) (entdel new_ent) (if (eq (length l_pt) 1) (setq nw_lst (cons (car l_pt) nw_lst))) ) ) ) ) (cond (nw_lst (mapcar '(lambda (x) (entmakex (list (cons 0 "RAY") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 (getvar "CLAYER")) (cons 62 5) (cons 100 "AcDbRay") (cons 10 x) dxf_11 ) ) ) nw_lst ) ) ) (setq nw_lst nil) ) ) (princ "\nSelect the reference line or <Enter for exit>.") ) ) ) (prin1) )
    1 point
  8. And what error are you seeing exactly? BTW... after entering the distance and bearing did you press the Enter key? The line you are being asked to draw should end up pointing northwest. See image below.
    1 point
  9. I have disabled orthomode and started the Line command. I hovered over the end point of the reference line and then let go of the mouse, When i enter For the next point type, at the command line, @113.66<N5d27'23"W it gives me an error. I am typing the cordinates exactly as is. What am I doing wrong?
    1 point
  10. Emmanuel Delay, Thank you very much for your Help! It works excellent!
    1 point
  11. A try with this which works with your example For baselines located in the east, west or north, the code must be improved... (defun find_inter (obj tmp_obj mod / vrt_pt pt lst_pt) (setq vrt_pt (vlax-variant-value (vla-IntersectWith obj tmp_obj mod))) (if (>= (vlax-safearray-get-u-bound vrt_pt 1) 0) (progn (setq pt (vlax-safearray->list vrt_pt)) (if pt (if (> (length pt) 3) (repeat (/ (length pt) 3) (setq lst_pt (cons (list (car pt) (cadr pt) (caddr pt)) lst_pt) pt (cdddr pt)) ) (setq lst_pt (cons pt lst_pt)) ) ) ) ) (if (and lst_pt (listp lst_pt)) lst_pt ) ) (defun C:3dwannab ( / ss n ent lst_pt ss_base dxf_ent pt_base ang dlt pt_tmp new_ent l_pt nw_lst) (princ "\nSelect polylines.") (setq ss (ssget '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) (cond (ss (repeat (setq n (sslength ss)) (setq ent (ssname ss (setq n (1- n))) lst_pt (append (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget ent))) lst_pt) ) ) (princ "\nSelect the reference line.") (while (not (setq ss_base (ssget "_+.:E:S" '((0 . "LINE")))))) (setq dxf_ent (entget (ssname ss_base 0)) pt_base (list (cdr (assoc 10 dxf_ent)) (cdr (assoc 11 dxf_ent))) ang (- (rem (angle (car pt_base) (cadr pt_base)) pi) (* pi 0.5)) dlt (distance (car pt_base) (cadr pt_base)) ) (foreach pt lst_pt (setq pt_tmp (inters (car pt_base) (cadr pt_base) pt (polar pt ang dlt))) (cond ((and pt_tmp (eq (sslength (ssget "_F" (list pt pt_tmp) '((0 . "LWPOLYLINE") (67 . 0) (8 . "TS_wall")))) 1)) (repeat (setq n (sslength ss)) (entmakex (list '(0 . "LINE") '(100 . "AcDbXline") (cons 10 pt) (cons 11 pt_tmp))) (setq new_ent (entlast) ent (ssname ss (setq n (1- n))) l_pt (find_inter (vlax-ename->vla-object ent) (vlax-ename->vla-object new_ent) acExtendNone) ) (entdel new_ent) (if (eq (length l_pt) 1) (setq nw_lst (cons (car l_pt) nw_lst))) ) ) ) ) (cond (nw_lst (mapcar '(lambda (x) (entmakex (list (cons 0 "XLINE") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 (getvar "CLAYER")) (cons 62 5) (cons 100 "AcDbXline") (cons 10 x) (cons 11 '(0.0 1.0 0.0)) ) ) ) nw_lst ) ) ) ) ) (prin1) )
    1 point
  12. I might be able to help you, however, it would have to be through this forum as I no longer run Microsoft 365. BTW... I have helped a number of Penn-Foster students with the Oleson Village project as well as others. If you search on the words "Penn-Foster" on this website it should bring up numerous threads many of which I participated in via text and images.
    0 points
×
×
  • Create New...