Jump to content

Leaderboard

Popular Content

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

  1. Version 1.3

    2,102 downloads

    Are you someone who likes to get details in your drawings done neatly? Then look no further! Here I present you a program that does just that. This program aligns selected objects to any direction the user wants to align them to. This provides that the objects possess at least one of the following properties: Insertion Point Text Position Text Alignment Position Center Upon issuing the command ATD, the user will be prompted a selection of objects without any filters, which the program will then filter based on the above (and xrefs excluded). The objects to be aligned will then be highlighted, and the user will be prompted a direction relative to the UCS. This can be in one of five ways: Clicking two points to determine direction Typing "X" - to align direction to X axis of UCS. Typing "Y" - to align direction to Y axis of UCS. Typing "PErpendicularToCurve" - the user specifies a point on any curve, and if a curve is detected, aligns perpendicular to the curve at that point. Typing "ALongCurve" - the user specifies a point on any curve, and if a curve is detected, aligns at the direction of the curve at that point Curve detection is compatible within all sorts of complex objects, such as nested blocks (with dynamic properties), xrefs, tables, dimensions, etc. regardless of depth, and fully functional under all UCS. Following this, the user can then specify an optional distance that would be used to align the objects, or choose the "Through" option. This makes up an exactly identical feature to the built-in AutoCAD OFFSET command. If a distance is specified, the user will also be specified a point that will be used to calculate the specified distance away from the point. If "Through" is chosen, the user will then be prompted the point to place the objects. If the distance has been chosen and specified, the user can click on the side that the user wishes to place the objects at that distance from the point. Objects that I've successfully worked with this program include: Tables Blocks OLE/Raster images Dimensions Texts and MTexts (regardless of alignment) Circles This program will work under any UCS settings provided that the objects to be translated lies in the same XY plane as the UCS.
    1 point
  2. Here you go, the idea behind coding the program this way seems insane and different. (defun c:exppl (/ ss fl op nr e a l) ;;----------------------------------------------------;; ;; Author : Tharwat Al Choufi ;; ;; website: https://autolispprograms.wordpress.com ;; ;;----------------------------------------------------;; (initget 6) (or (setq nr (getint "\nNumber of first point <1> : ")) (setq nr 1) ) (princ "\nSelect polylines :") (and (setq ss (ssget ":S" '((0 . "LWPOLYLINE,POLYLINE")))) (setq fl (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4) ) ) (setq op (open (strcat (getvar "dwgprefix") fl "_exppl.txt") "w")) (progn ((lambda (i / g m p d) (while (setq e (ssname ss (setq i (1+ i)))) (setq g (entget e) a (assoc 10 g) m (cdr (cddddr (member a g))) g (append g (list a)) a (cdr a) l nil ) (or l (setq l a)) (mapcar '(lambda (x) (and (= (car x) 10) (setq p (cdr x)) (write-line (strcat (itoa nr) "," (rtos (cadr a) 2 3) "," (rtos (car a) 2 3) "," (rtos (distance a p) 2 3)) op ) (setq nr (1+ nr) a p ) ) ) m ) (write-line (strcat (itoa nr) "," (rtos (cadr a) 2 3) "," (rtos (car a) 2 3) "," (rtos (distance a l) 2 3)) op ) (setq nr (1+ nr)) (foreach itm (list (list "Perimeter = " (vlax-curve-getdistatparam e (vlax-curve-getendparam e) ) ) (list "Area = " (vlax-curve-getarea e)) ) (write-line (strcat (car itm) (rtos (cadr itm) 2 3)) op) ) ) ) -1 ) (close op) ) ) (princ) ) (vl-load-com)
    1 point
  3. One of the things with color is if its bylayer then it does not have a color in the entget, no 62, so if its nil then you need to get the Layer color. Test (entget (car (entsel "\nPick text "))) Example (setq col (vla-get-color (vlax-ename->vla-object e))) (if (= col 256) (setq col (cdr (assoc 62 (tblsearch "LAYER" lay)))) )
    1 point
  4. Version 1.0.0

    4,651 downloads

    Here are 16 variants of TSP*.lsp... First one : TSP-NS.lsp - You use it if you have plenty of time and you want as much better results as possible... But I don't recommend it, as it's too slow... Second one : TSP-NF.lsp - You use it if you need both better results, but you have a time for a lunch, so you still need to wait to finish... Third one : TSP-FN.lsp - Similar to TSP-NF.lsp... Fourth one : TSP-FF.lsp - You use it if you need both better results, but you have a time for a cup of coffee, so you still need to wait to finish... Fifth one : TSP-FFF.lsp - You don't have any time at all and you still need some or any result that has any meaning related to TSP... Sixth one : TSP-FFFF.lsp - Even faster than *-FFF version... Seventh one : TSP-lsp-func.lsp - best of speed/quality... Eighth one : TSP-N.lsp - similar to TSP-NN, or TSP-NF... Ninth one : TSP-MR-2D.lsp - wrapper that uses both power of LISP and ObjectARX... Tenth one : TSP-MR-3D.lsp - wrapper that uses both power of LISP and ObjectARX... Eleventh one : TSP-MR-AROUND-CONCAVE.lsp - very nice little routine to make stars from radially disposition of points... Twelfth one : TSP-ARX-BRX-N.lsp - combined power of LISP and ObjectARX... Thirteenth one : TSP-ARX-BRX-F.lsp - combined power of LISP and ObjectARX... Fourteenth one : TSP-cheapestpath - full power of ObjectARX... Fifteenth one : TSP.lsp - wrapper for grid and rnd disposition - LISP and ObjectARX Sixteenth one : TSP-lsp-func.lsp - previous version of TSP - pure LISP... So I recommend auto loading TSP.lsp, TSP-MR-AROUND-CONCAVE.lsp and TSP-cheapestpath.lsp Big thanks to Daniel from www.theswamp.org for providing *.arx and *.brx files for AutoCAD 2021-2023 and BricsCAD V23... More info and newly added *.arx, *.brx, ... at this link : https://www.theswamp.org/index.php?topic=58049.0 HTH. M.R.
    1 point
×
×
  • Create New...