Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/04/2021 in all areas

  1. like @dan20047 said getfiled is used to get a file path by prompting the user to pick a location. It isn't used in creating said file. I added ldata to save the variable idx and allow it to persist between commands and even when the drawing is saved and reopened. User will see this outputted to the command prompt C:\Users\UserName\Desktop\Drawing1_#.shc File Created (defun function (/ idx DN F) (vl-load-com) ;needed with any vla or vlax commands (setq idx (vlax-ldata-get "g_pneti" "File")) ;checks for ldata and sets the variable (if (= idx nil) (setq idx 0)) ; if varable is still nil sets it to 0 (setq idx (1+ idx)) (setq DN (vl-filename-base (getvar 'dwgname))) (setq F (open (strcat (getenv "UserProfile") "\\Desktop\\" DN "_" (itoa idx)".shc") "w")) (princ "Wright Stuff to file in same line\n" F) (princ "Next line \n" F) ;and so on (close F) (prompt (strcat"\n" (getenv "UserProfile") "\\Desktop\\" DN "_" (itoa idx)".shc File Created")) (vlax-ldata-put "g_pneti" "File" idx) ;save variable to ldata persists in drawing when saved. (princ) ) --- Edit Please note if you have 2 drawings named the same their is a possibility of overwriting the shc data if you leave it on your desktop. ---Edit 2 You could use "a" instead of "w" and have everything in one shc file. split it up with some princ between the data output so its easier to see. (princ "\n" fp) (princ "==============================================================" fp) (princ (strcat "Output " (itoa idx)) so it would show up like ============================================================== Output 1 data ... ============================================================== Output 2 more data
    1 point
  2. If you want to go backwards, just input a negative value. And besides, in that program, you can pick the start anywhere you want.
    1 point
  3. It seems a contradiction to not want a dialog box when using the getfiled command, which explicitly is for calling a dialog? Why not just use getstring?
    1 point
  4. What are terrace houses? Literally, one can do it, but the code requirements around here make it very expensive to work with, and the valley has to have a slope. One can't just slide a hip roof halfway into a gable side slope. The result would be a level valley that would not drain completely after rain or snow. The valley needs a ramp built into it. The yard may as well slope toward the house on all four sides otherwise. Oh, yeah. In snow country you can get a roof to cave in that way. Here in Florida the inspector is hyper-sensitive about roof construction. We have these fun events called Hurricanes here. There are no hips on the OP's example photo. I wonder if the correct roof type option was chosen in the drawing.
    1 point
×
×
  • Create New...