Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2024 in all areas

  1. slightly off topic , it irritated me edit boxes are only left aligned so just for fun (app doesn't actually do anything) : ;;; just for fun , center texts in editboxes - rlx jun'24 (defun c:jff ( / center-factor ) (create_dialog) (princ) ) ;;;|-----------------------------------------------------------------------| ;;;| Just For Fun - Center text in editboxes - rlx jun-2024 | ;;;|-----------------------------------------------------------------------| ;;;| editbox1 editbox2 editbox3 | ;;;| [ ] [ ] [ ] | ;;;| | ;;;| [ <-- ] [ done ] [ --> ] | ;;;| | ;;;|-----------------------------------------------------------------------| ;;; dcl_jff input : m = message , l = label list , v = (default) values list ;;; (dcl_jff "Just For Fun - Center text in editboxes - rlx'24" ;;; '("editbox1" "editbox2" "editbox3") '("Dragons" "just wanna" "have fun")) (defun dcl_jff (m l v / f p d r) (and (setq p (open (setq f (vl-filename-mktemp ".dcl")) "w")) (write-line (strcat "dcl_jff:dialog {label=\"" m "\";:row {") p) (write-line (strcat ":column {children_alignment=centered;:text {label=\"" (nth 0 l) "\";}:edit_box {edit_width=24;key=\"eb1\";}}") p) (write-line (strcat ":column {children_alignment=centered;:text {label=\"" (nth 1 l) "\";}:edit_box {edit_width=24;key=\"eb2\";}}") p) (write-line (strcat ":column {children_alignment=centered;:text {label=\"" (nth 2 l) "\";}:edit_box {edit_width=24;key=\"eb3\";}}}spacer;") p) (write-line (strcat ":concatenation {alignment=centered;" ":button {key=\"bt1\";label=\"" (nth 3 l) "\";} spacer;" ":button {is_default=true;key=\"bt2\";label=\"" (nth 4 l) "\";}spacer;" ":button {key=\"bt3\";label=\"" (nth 5 l) "\";}}}") p) (not (setq p (close p))) (< 0 (setq d (load_dialog f))) (new_dialog "dcl_jff" d) (mapcar '(lambda (x y)(set_tile x y)) '("eb1" "eb2" "eb3") v) (CenterEditboxStrings) (action_tile "bt1" "(Update_Edit_Box_Center_Factor 1)") (action_tile "bt2" "(setq r (list (get_tile \"eb1\")(get_tile \"eb2\")(get_tile \"eb3\")))(done_dialog 1)") (action_tile "bt3" "(Update_Edit_Box_Center_Factor 0)") (start_dialog)(unload_dialog d) (vl-file-delete f) ) r ) (defun Update_Edit_Box_Center_Factor ( i / f ) (if (null Center-Factor) (setq f 6) (setq f Center-Factor)) (cond ((= i 1) (setq f (1+ f)))((= i 0) (setq f (1- f)))(t (setq f 1))) (if (< f 1)(setq f 1)) (setq Center-Factor f) (CenterEditboxStrings) ) (defun create_dialog () (alert (vl-princ-to-string (dcl_jff "Just For Fun - Center text in editboxes - rlx'24" '("editbox1" "editbox2" "editbox3" " <--- " "Done" " ---> ") '("Dragons" "Just Wanna" "Have Fun") ) ) ) ) (defun CenTileText ($k / v x l) (if (null center-factor)(setq center-factor 6)) (setq v (vl-string-trim " " (get_tile $k)) l (strlen v) x (fix (/ (dimx_tile $k) center-factor))) (if (< l x) (repeat (- x l)(setq v (strcat " " v)))) (set_tile $k v)) (defun CenterEditboxStrings ( / tl ) (setq tl '("eb1" "eb2" "eb3")) (foreach tile tl (CenTileText tile))) (c:jff)
    2 points
  2. If the goal is making a DWT "export Template" why would you need to keep changing ? Would it not be just as easy to make a script file and edit that ? In a package we had correct layer linetype and color based on draw an object like a wall or a door etc, behind it was a text file with all the settings 91 different layers. The reason I mention it is that you must still be ridged in setting correct layer so we use menu options to force this. In this house every layer is correct as the set layer has been taken away from the end user. Of course you can still not use the inbuilt functions and draw on wrong layers but no automation. For a recent client request, Text and Dims are in a menu so all objects drawn are to company standards. You could possibly do a reactor check for "HATCH" and set layer but don't have that code.
    2 points
  3. condition : 1. All objects are straight lines with 3D points. 2. When they intersect, the end points meet. = Intersections that do not meet endpoints are not valid. The steps I've been thinking : 1. get dxf numbers 10 and 11 to create a point list in a row. this is main point list 2. If both endpoints of a line are unique in the point list, they are created into separate groups and delete from the main point list. 3. Start grouping based on one reference line. 4. Find other lines that share the same endpoint as this reference line, Two points of the original line are removed from the main point list. opposite point of the collected lines is used as the next net. 5. counts each time captures a line, and when no more can be collected, group with entity names are extracted by forming them into a list within a list. and go back to step 3. starts collecting the next group. 6. It ends when the number of members in the main point list becomes 0, and different colors are assigned to each group. If there is a better way, please let me know.
    1 point
  4. https://www.theswamp.org/index.php?topic=59615.0 Search Outlines: (defun c:xdtb_searchoutlines (/ ss) (xdrx-begin) (xd::doc:getdouble (xdrx-string-multilanguage "\n输入容差" "\nInput tolerance") "#xd-var-global-equalpoint-tol" (xdrx-getvar "equalpoint") ) (xdrx-sysvar-push (list "equalpoint" #xd-var-global-equalpoint-tol)) (and (setq ss (xdrx-ssget (xdrx-string-multilanguage "\n选择生成regions的曲线<退出>:" "\nSelect to generate Curves for regions <Exit>:" ) '((0 . "*line,arc")) ) ) (setq ss (xdrx-geom-searchoutline ss)) (xdrx-prompt (xdrx-string-formatex (xdrx-string-multilanguage "\n生成了 %d 个regions." "\nGenerated %d regions." ) (sslength ss) ) ) ) (xdrx-sysvar-pop) (xdrx-end) (princ) ) ===================================== The above code uses XDrx API, download link: https://github.com/xdcad/XDrx-API-zip https://sourceforge.net/projects/xdrx-api-zip/ Dual version link: https://github.com/xdcad
    1 point
  5. Dear Steven Thansk sir following your method
    1 point
×
×
  • Create New...