Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/23/2025 in all areas

  1. @pondpepo9 I can't tell you if what you are looking for exists unless you can be more specific on what you want. Ideally, post a DWG with the Before and After and explain in more detail what the workflow should be. Then if someone has something they are willing to share, write, or alter - we can let you know. PLEASE NOTE: This is not a forum just to order up free programs. We prefer helping those who wish to learn programming and need a place to start, which is the purpose of this forum.
    2 points
  2. hello everyone, I am a civil 3d guy but just recently left my job (bad management) and got a telecommunications job. It's way faster pace than I would like also alot to check so high chance of errors. been there 3 weeks now and I feel slow. anyone work in telecommunications? if so what tips can you give ? kind of scared I will never get fast enough for this discipline and get the boot.
    1 point
  3. (defun c:lwlines-blks ( / mid car-sort online ss i blks ll ur plst p pp ppp sppp mp rtn k li li1 li2 ) (or (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-get-acad-object) nil))) (vl-load-com)) (defun mid ( p1 p2 ) (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) p1 p2) ) (defun car-sort ( lst func / itm rtn ) (setq itm (car lst)) (foreach a (cdr lst) (if (apply func (list a itm)) (setq itm a rtn a) (setq rtn itm) ) ) rtn ) (defun online ( p1 p p2 ) (equal (distance p1 p2) (+ (distance p1 p) (distance p p2)) 1e-6) ) (if (setq ss (ssget (list (cons 0 "INSERT")))) (repeat (setq i (sslength ss)) (setq blks (cons (ssname ss (setq i (1- i))) blks)) ) ) (foreach blk blks (vla-getboundingbox (vlax-ename->vla-object blk) (quote ll) (quote ur)) (mapcar (function set) (list (quote ll) (quote ur)) (mapcar (function safearray-value) (list ll ur))) (setq plst (cons (mid ll ur) plst)) ) (setq p (car-sort plst (function (lambda ( a b ) (if (= (cadr a) (cadr b)) (< (car a) (car b)) (< (cadr a) (cadr b))))))) (setq rtn (cons p rtn)) (while plst (setq plst (vl-remove p plst)) (if (setq pp (car-sort plst (function (lambda ( a b ) (< (distance p a) (distance p b)))))) (progn (setq rtn (cons pp rtn)) (setq p pp) ) (progn (if plst (setq rtn (cons (car plst) rtn)) ) (setq plst nil) ) ) ) (setq rtn (reverse rtn)) (setq ppp rtn) (setq p (car rtn)) (foreach pp (cdr rtn) (if (and (nth (1+ (vl-position pp (cdr rtn))) (cdr rtn)) (online p pp (nth (1+ (vl-position pp (cdr rtn))) (cdr rtn)))) (progn (setq p pp) (setq rtn (vl-remove pp rtn)) ) (setq p pp) ) ) (setq k 1) (while rtn (setq k (1+ k)) (if (= 0 (rem k 2)) (setq li (list (car rtn) (cadr rtn))) (setq li (list (cadr rtn) (car rtn))) ) (setq mp (mid (car rtn) (cadr rtn))) (setq sppp (vl-sort ppp (function (lambda ( a b ) (< (distance mp a) (distance mp b)))))) (setq sppp (list (car sppp) (cadr sppp))) (setq li1 (list (car li) (car-sort sppp (function (lambda ( a b ) (< (distance (car li) a) (distance (car li) b))))))) (setq li2 (list (car-sort sppp (function (lambda ( a b ) (< (distance (cadr li) a) (distance (cadr li) b))))) (cadr li))) (setq rtn (cddr rtn)) (vl-cmdf "_.pline") (foreach p li1 (vl-cmdf "_non" p) ) (vl-cmdf "") (vl-cmdf "_.pline") (foreach p li2 (vl-cmdf "_non" p) ) (vl-cmdf "") ) (princ) ) HTH. M.R.
    1 point
  4. I suppose that an algorithm could be designed to control and optimize the distribution of the circles, so that the misalignments are proportional throughout the perimeter. But this would be costly in terms of work and time.
    1 point
  5. Yes It is a good idea to optimize the space to allow for as many circles as possible. If Nikon does not mind modifying its original concept, the tessellation could be built from the first possible circle. However, it is still possible that a better fit in one area produces a mismatch in another.
    1 point
  6. For waffle slabs did something similar, you select pline shape and pick a control point then make an array in this case of 2 staggered rows of circles, Remove all circles touching or outside the shape so all done. Will see if can find time to provide some code.
    1 point
  7. I've thought better of it. I think the best way to filter the choice of triangles is by the angle relationship between their vertices. This way the problem of the difference in the number of vertices of each 3D polyline will be greatly minimized. That's why I've dared to modify your 'SX:M3DFACEF3DPL' function by adding a couple of new functions that serve to select the vertices of each '3DFACE' I haven't tested it in depth. So it's possible that some unforeseen situation may arise. If so, let me know and I'll help you find a solution. (defun SX:M3DFACEF3DPL (/ enameOne enameSecond old_layer layerNameBase dataOne ptOne ptlistOne dataSecond ptSecond ptlistSecond len i j pt1 pt2 pt3 ind1 ind2 ang_sub_ref decideTRI ) (defun ang_sub_ref (pta ptb pt1 / ang_result ang_ref ang ang_desde_ptb ) (if ptb (progn (setq ang_ref (angle pta ptb) ang_desde_ptb (angle ptb pt1) ) (cond ((< (abs (setq ang (- ang_ref ang_desde_ptb))) PI) ang ) ((and (> (abs (setq ang (- ang_ref ang_desde_ptb))) PI) (<= ang_ref PI) ) (+ ang_ref (- (* 2 PI) ang_desde_ptb)) ) ((and (> (abs (setq ang (- ang_ref ang_desde_ptb))) PI) (> ang_ref PI) ) (- (- ang_ref (* 2 PI)) ang_desde_ptb) ) (T (PRINC "\n**Caso no esperado en ang_sub_ref") ) ) (if ang (if (> (setq ang (abs ang)) (* 2 PI)) (setq ang (abs (- (- ang (* 2 PI)) PI))) (abs (- ang pi)) ) ) ) 1000 ) ) (defun decideTRI (/ a b) (if (= (min (setq a (abs (- (ang_sub_ref (nth ind1 ptlistOne) (nth (1+ ind1) ptlistOne) (nth ind2 ptlistSecond) ) (/ pi 2.0) ) ) ) (setq b (abs (- (ang_sub_ref (nth ind2 ptlistSecond) (nth (1+ ind2) ptlistSecond) (nth ind1 ptlistOne) ) (/ pi 2.0) ) ) ) ) a ) (setq pt1 (nth ind1 ptlistOne) pt2 (nth (1+ ind1) ptlistOne) pt3 (nth ind2 ptlistSecond) ind1 (+ ind1 1) ) (setq pt1 (nth ind2 ptlistSecond) pt2 (nth (1+ ind2) ptlistSecond) pt3 (nth ind1 ptlistOne) ind2 (+ ind2 1) ) ) ) (command-s "_UNDO" "BE") (setq enameOne (car (entsel "\nSelect the first 3DPOLYLINE:")) enameSecond (car (entsel "\nSelect the second 3DPOLYLINE:")) ) (while (or (= enameOne nil) (not (= "POLYLINE" (cdr (assoc 0 (entget enameOne))))) ) (if (= enameOne nil) (progn (prompt "\nNothing was selected. Try again...") (setq enameOne (car (entsel "\nSelect the first 3DPOLYLINE:"))) (princ) ) (progn (prompt "\nSelected entity must be 3DPOLYLINE. Try again..." ) (setq enameOne (car (entsel "\nSelect the first 3DPOLYLINE:"))) (princ) ) ) ) (while (or (= enameSecond nil) (not (= "POLYLINE" (cdr (assoc 0 (entget enameSecond))))) ) (if (= enameSecond nil) (progn (prompt "\nNothing was selected. Try again...") (setq enameSecond (car (entsel "\nSelect the second 3DPOLYLINE:")) ) (princ) ) (progn (prompt "\nSelected entity must be 3DPOLYLINE. Try again..." ) (setq enameSecond (car (entsel "\nSelect the second 3DPOLYLINE:")) ) (princ) ) ) ) (setq old_layer (getvar 'clayer) layerNameBase (cdr (assoc 8 (entget enameOne))) ) (setvar 'clayer layerNameBase) ;;; (setq objOne (vlax-ename->vla-object enameOne) ;;; objSecond (vlax-ename->vla-object enameOne) ;;; ) (setq dataOne (entget enameOne)) (while (/= (cdr (assoc 0 dataOne)) "SEQEND") (setq ptOne (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dataOne) ) ) (if (/= (nth 0 (nth 0 ptOne)) 0.0) (setq ptlistOne (cons ptOne ptlistOne)) ) (setq dataOne (entget (entnext (cdr (assoc -1 dataOne))))) ) (setq ptlistOne (mapcar 'car ptlistOne)) ; lista de puntos de la primera polilínea 3D (setq dataSecond (entget enameSecond)) (while (/= (cdr (assoc 0 dataSecond)) "SEQEND") (setq ptSecond (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dataSecond ) ) ) (if (/= (nth 0 (nth 0 ptSecond)) 0.0) (setq ptlistSecond (cons ptSecond ptlistSecond)) ) (setq dataSecond (entget (entnext (cdr (assoc -1 dataSecond))))) ) (setq ptlistSecond (mapcar 'car ptlistSecond)) ; lista de puntos de la segunda polilínea 3D (setq ptlistOne (reverse ptlistOne)) (setq ptlistSecond (reverse ptlistSecond)) ;;; (if (> (length ptlistOne) (length ptlistSecond)) ;;; (progn ;;; (setq len (length ptlistOne) ;;; i 0 ;;; j 0 ;;; ) ;;; ) ;;; (progn ;;; (setq len (length ptlistSecond) ;;; i 0 ;;; j 0 ;;; ) ;;; ) ;;; ) ;;; (while (< i len) ;;; (if (/= (nth (1+ i) ptlistOne) nil) ;;; (entmake (list (cons 0 "3DFACE") ;;; (cons 10 (nth i ptlistOne)) ;;; (cons 11 (nth j ptlistSecond)) ;;; (cons 12 (nth (1+ i) ptlistSecond)) ;;; (cons 13 (nth i ptlistOne)) ;;; ) ;;; ) ;;; ) ;;; (if (and (/= (nth (1+ i) ptlistOne) nil) ;;; (/= (nth (1+ j) ptlistSecond) nil) ;;; ) ;;; (entmake (list (cons 0 "3DFACE") ;;; (cons 10 (nth (1+ i) ptlistOne)) ;;; (cons 11 (nth (1+ j) ptlistSecond)) ;;; (cons 12 (nth i ptlistOne)) ;;; (cons 13 (nth (1+ i) ptlistOne)) ;;; ) ;;; ) ;;; ) ;;; (setq i (1+ i) ;;; j (1+ j) ;;; ) ;;; ) (setq ind1 0 ind2 0 ) (while (and (nth ind1 ptlistOne) (nth ind2 ptlistSecond) (or (nth (1+ ind1) ptlistOne) (nth (1+ ind2) ptlistSecond)) ) (decideTRI) (entmake (list (cons 0 "3DFACE") (cons 10 pt1) (cons 11 pt2) (cons 12 pt3) (cons 13 pt1) ) ) ) (setvar 'clayer old_layer) (command-s "_UNDO" "E") (princ) )
    1 point
  8. 2012年的发的文章,时隔13年居然依旧是互联网上延曲线填充唯一的解决方案,谢谢!伟大无需多言。 现在已经是2025年了,应该不用我翻译成英文回帖子了 表达一下感谢
    1 point
×
×
  • Create New...