Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/04/2023 in all areas

  1. Here you have it, just try to match the parenthesis (defun c:FT ( / fo txt pt1 pt2) (setq folder "c:\\fatih\\") (setq file (strcat folder (getvar "dwgname") ".csv")) (setq fo (open (setq fname file) "a")) (write-line "Size,Length" fo) (while (setq tent (entsel "Pick text")) (setq txt (cdr (assoc 1 (entget (car tent))))) (setq sumdist 0) (setq P1 (getpoint "\nSelect first point: ")) (while (setq P2 (getpoint P1 "\nSelect next point, or press Enter to close: ")) (prompt (strcat "\nLatest distance = " (rtos (distance P1 P2)) ",\nCumulative distance = " (rtos (setq sumdist (+ sumdist (distance P1 P2)))) ); end strcat ); end prompt (setq P1 P2) ); end while (prompt (strcat "\nTotal sum of distances = " (rtos sumdist))) (princ) (write-line (strcat txt "," (rtos sumdist 2 0)) fo) (princ) ); end while (close fo) ); end defun And always a pretty-print is very helpful
    2 points
  2. Indents help - should be clearer now? (defun c:FT ( / fo txt pt1 pt2) (setq folder "c:\\fatih\\") (setq file (strcat folder (getvar "dwgname") ".csv")) (setq fo (open (setq fname file) "a")) (write-line "Size,Length" fo) (while (setq tent (entsel "Pick text")) (setq txt (cdr (assoc 1 (entget (car tent))))) (setq sumdist 0) (setq P1 (getpoint "\nSelect first point: ")) (while (setq P2 (getpoint P1 "\nSelect next point, or press Enter to close: ")) (prompt (strcat "\nLatest distance = " (rtos (distance P1 P2)) ",\nCumulative distance = " (rtos (setq sumdist (+ sumdist (distance P1 P2)))) ); end strcat ); end prompt (setq P1 P2) ); end while (prompt (strcat "\nTotal sum of distances = " (rtos sumdist))) (princ) (write-line (strcat txt "," (rtos sumdist 2 0)) fo) (princ) ); end while (close fo) ) );
    2 points
  3. Your Properties palette must be docked. In order to undock the palette, you have two options. Either click and drag the palette away from its docked location or right click at the top of the palette and uncheck "Allow Docking". Once the palette is undocked you can right click on the bar and uncheck "Auto Hide".
    1 point
  4. Ok first thing my preference is for using layouts not all in model space, so most of my code is written around that method. The menu does as hinted above looks at title block in each layout and sets correct values. For pdf can do plot a range of layouts handy when you update say 1 or 2 sheets. Last question do you know how to make a menu, that is a custom mnu say using notepad, as per image can have lots of stuff in a menu.
    1 point
×
×
  • Create New...