Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/31/2021 in all areas

  1. Good day, I've been tasked with rotating a lot of blocks in map drawings in such a way that they are aligned with the line below them, as seen on the picture below. It was explained to me to do this manually for each drawing, which can be thousands of these operations. To save my sanity, I've looked around the forum and the internet for a LISP that would help me do this task automatically, but to no success. Could anyone please help me automate this or at least point me to a right direction? Initial conditions: -centers of blocks lie on a polyline -polyline and blocks are the same layer -there is always only 1 polyline intersecting the block's center point -forward/back direction of the assymetrical blocks, like the triangle on the pic below, is not relevant (likely can't be automated, requires context to decide) Ideally (if possible) the user input for this script would be: -select relevant blocks -select relevant polylines LISPs that I've been using so far (this forum is awesome!): -replace all selected blocks with another block (LISP by alanjt) -replace list of blocks with another list of blocks (LISP by tharwat and modified LISP by ronjonp to use wildcards) The problem:
    1 point
  2. It seems like all you have to do is rotate all the blocks 90 degrees . https://autocadtips1.com/2014/02/01/autolisp-rotate-multiple-objects-around-their-base-point/
    1 point
  3. Ok some more big hints, thickness for walls, pface for roofs, same for gable wall ends. Think more 2 1/2D. This was done in a cheap house package, its like 30 years old, if interested PM me. Yes does the elevations as previously suggested in a layout, look at Vpoint. -vpoint 1,1,1 (if (= look "R")(command-s "-vpoint" "1,0,0")) (if (= look "L")(command-s "-vpoint" "-1,0,0")) (if (= look "F")(command-s "-vpoint" "0,-1,0")) (if (= look "B")(command-s "-vpoint" "0,1,0")) (if (= look "P")(command-s "-vpoint" "0,0,1")) There is a good lisp for roofs, "2droof-final-new.lsp" search here. Had a look at dwg and pretty sure this could help CA5SLWAL.LSP:;;; erases a wall line and replaces with a 3dface with different slopes ; program starts here (setq tp1 (entsel "\nSelect wall near left end : ")) (setq wa_ht1 (getint "\nEnter 1st wall ht ")) (setq wa_ht2 (getint "\nEnter 2nd wall ht ")) rest of code copyright
    1 point
  4. I, however, usually rotate the plan to give one face that is orthogonal. Copy it three times, rotating it by 90 degrees each time. Then rotate3d to give elevations in each direction. I do this because I prefer to work in plan view, and each elevation does not need to see the detail from the other faces. When you rotate by reference, choose the base point at one end of a line, specify R for reference, specify the reference angle by choosing the first point again, then choose the other end of you line as the second point, then if you activate Ortho, when you have to choose the new angle, you can see the proper angle and merely click to choose that angle.
    1 point
  5. Try this not sure what your tagname is for Label block, change code. ; https://www.cadtutor.net/forum/topic/73046-dcl-load-next-number-value-into-box/ ; version by AlanH May 2021 (defun writedcl ( / fo) (if (= cnt nil)(setq cnt 1)) (setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w")) (write-line "test6 : dialog {" fo) (write-line ": column { " fo) (write-line ": row { " fo) (write-line ": edit_box { " fo) (write-line "key = \"number\" ; " fo) (write-line "edit_width = 15 ; " fo) (write-line "fixed_width = true ; } " fo) (write-line ": button { label = \"Load\" ; " fo) (write-line "key = \"load\" ; " fo) (write-line "width = 12 ; }} " fo) (write-line ": row { " fo) (write-line ": button {label = \"OK\" ; " fo) (write-line "key = \"accept\" ; " fo) (write-line "alignment = left ; width = 12 ; " fo) (write-line "is_default = true ; }}}} " fo) (close fo) (princ) ) (defun resetnum ( / numl ss) (setq numl 0) (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "Label")))) (repeat (setq x (sslength ss)) (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS (setq x (- x 1))) ) 'getattributes) (if (= tagname (vla-get-tagstring att)) (princ (setq num (atoi (vla-get-textstring att)))) ) ) (if (< maxnbr num)(setq maxnbr num)) ) (set_tile "number" (rtos maxnbr 2 0)) (princ) ) (defun pickpt ( / pt ) (while (setq pt (getpoint "\nPick insertion point ")) (command "-insert" "label" pt 1 1 0 (rtos maxnbr 2 0)) (setq maxnbr (1+ maxnbr)) ) (princ) ) (setq tagname "TAG1") ; for testing (defun c:test6 ( / pt) (if (= maxnbr nil)(setq maxnbr 1)) (writedcl) (setq dcl_id (load_dialog fname)) (if (not (new_dialog "test6" dcl_id)) (exit) ) (set_tile "number" (rtos maxnbr 2 0)) (mode_tile "number" 3) (action_tile "number" "(setq maxnbr (atoi $value))") (action_tile "load" "(resetnum)") (action_tile "accept" "(unload_dialog dcl_id)") (start_dialog) (vl-file-delete fname) (pickpt) (princ) ) (c:test6)
    1 point
×
×
  • Create New...