Jump to content

Leaderboard

Popular Content

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

  1. another way if you are creating alot of things at once. (setq ssnew (ssadd)) ;blank selection set. (setq LastEnt (entlast)) ;put this before anything is created or modified. ;rest of your code (if (setq en (entnext LastEnt)) ;pick up anything made or modified in the drawing since LastEnt was defined. (while en (ssadd en ssnew) (setq en (entnext en)) ) ) (command "_.mirror" ssnew pt1 pt2"") ;mirror those objects in the drwaing.
    2 points
  2. If you look at ssadd and create a selection set with that, would it work? perhaps ... some code (setq New_Objs (ssadd)) ; create blank / emp[ty selection set .....some more code, create an object (ssadd (entlast) New_Objs) .. some more code (command '_Mirror.....
    2 points
  3. Look for (vlax-curve-getclosestpointtoprojection) function... You make line horizontaly like in your picture, then measure - 1.0, then (foreach pt pts => (setq ptn (vlax-curve-getclosestpointtoprojection spline pt '(0.0 1.0 0.0)))... So ptn are your new points on spline - then just use (entmake) or POINT command to place them on spline...
    1 point
  4. Oops, I edited the last post, I had replaced (setq points (append points (list (drawPoint pt)))) with another function that I ended up scrapping. Copy paste the code again please.
    1 point
  5. @ASQ, Maybe it can be done by ODBX, please upload at least 3 samples.dwg
    1 point
  6. Scales are not tables, but they are stored in a dictionary: (defun GetScaleList (/ ScaleList ScaleListDict ScaleListEnts N MASSOC) (defun MASSOC (KEY ALIST / X NLIST) (foreach X ALIST (if (eq KEY (car X)) (setq NLIST (cons (cdr X) NLIST)) ) ) (reverse NLIST) ) (setq ScaleListDict (dictsearch (namedobjdict) "ACAD_SCALELIST") ScaleListEnts (MASSOC 350 ScaleListDict) ScaleList (list "") N 0 ) (repeat (length ScaleListEnts) (setq ScaleList (cons (cdr (assoc 300 (entget (nth N ScaleListEnts)))) ScaleList) N (1+ N) ) ) (setq ScaleList (cdr (reverse ScaleList))) ) But you don't have to check if the scale already exists. You can recreate the scale if needed. Here is what I use: (defun c:1:1 ()(MaakSchaal 1)) (defun c:1:2 ()(MaakSchaal 2)) (defun c:1:5 ()(MaakSchaal 5)) (defun c:1:10 ()(MaakSchaal 10)) (defun c:1:20 ()(MaakSchaal 20)) (defun c:1:50 ()(MaakSchaal 50)) (defun c:1:100 ()(MaakSchaal 100)) (defun c:1:200 ()(MaakSchaal 200)) (defun c:1:500 ()(MaakSchaal 500)) (defun c:1:1000 ()(MaakSchaal 1000)) (defun c:1:2000 ()(MaakSchaal 2000)) (defun c:1:5000 ()(MaakSchaal 5000)) (defun c:1:10000 ()(MaakSchaal 10000)) (defun MaakSchaal (waarde / e schaal) (command ".undo" "be") (setq schaal (strcat "1:" (itoa waarde))) (setq e (getvar "EXPERT"))(setvar "EXPERT" 5) (command ".-scalelistedit" "A" schaal schaal "Exit") (setvar "EXPERT" e) (if (inPspace) (princ (strcat "\n" schaal " is added to the scalelist.")) ; else (setvar "CANNOSCALE" schaal) ) (command ".undo" "end") (princ) ) (defun inPSPACE ()(and (zerop (getvar "TILEMODE"))(zerop (getvar "VPMAXIMIZEDSTATE"))(eq (getvar "CVPORT") 1)))
    1 point
×
×
  • Create New...