Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/08/2024 in all areas

  1. shouldn't have that... entmod them all to 0 extrusion?
    1 point
  2. I've noticed that the extrusion direction dxf code 210 is different on both hatches.
    1 point
  3. It would be a huge undertaking on the existing detail library in the office to redraw everything but I guess that's what I'm going to have to do. I wasn't aware that objects can still have their own UCS. I don't understand how they can appear flat in the front view. FRONT VIEW OF THE ATTACHED (not very exciting to look at) Hatch example.dwg
    1 point
  4. Can you try the attached? It doesn't work for me. test.dwg
    1 point
  5. Drawing Set Descriptions (.dsd)... AutoCAD LT 2022 Help | To Create a List of Drawings to Publish | Autodesk AutoCAD 2023 Help | Publish Dialog Box | Autodesk
    1 point
  6. .dsd isn't a file type I know or have used, why that one? Are you able to go a bit simpler, instead of creating an external file create a little LISP that assesses the drawing and which space the border details are saved in and then publish from there? You can share that LISP with colleagues who can do the same thing without needing access to the external file? But back to the original question, instead or 'w'riting to the text file, check the file exists and then 'A'ppend to the file LISP something like this to get where the border is located. Assuming that the border is / contains a unique block (user specified and hard coded in the LISP... it is possible to use wildcards if say border blocks are "A1 Border" "A2 Border" and so on (defun c:BorderSpace ( / BorderName MyBorder BorderSpace) (setq BorderName "My_Border_Block_Name") ;USer defined border block name (setq MyBorder (ssget "_X" (list (cons 2 BorderName)))) ;; search drawing for the border block ;; Add here check in in case there is no block, BorderName inserted ;; (setq BorderSpace (cdr (assoc 410 (entget (ssname MyBorder 0))))) ; get the 'space' birder block is inserted in ;; Do plotting / publish routine from here ;; ;;....... ) You can add the details from your LISP to find file locations and so on as required,
    1 point
  7. Command DLBL (for Draw Line from Blocks to Line) (defun drawLine (p1 p2) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))) ;; DLBL for Draw Line from Blocks to Line (defun c:DLBL ( / ln blks i p1 p2) (setq ln (car (entsel "\nSelect line: " ))) (princ "\nSelect blocks: ") (setq blks (ssget (list (cons 0 "INSERT")))) (setq i 0) (repeat (sslength blks) ;; p1: insertpoint of the block (setq p1 (cdr (assoc 10 (entget (ssname blks i))))) ;; p2: closest point, perpendicular to the line. (setq p2 (vlax-curve-getClosestPointTo ln p1)) (drawLine p1 p2) (setq i (+ i 1)) ) )
    1 point
  8. You can obtain the parent block reference from a selected attribute reference by querying the entity stored in DXF group 330 (which stores a soft pointer to the owner) - here is an example: (defun c:test ( / att atx ) (while (progn (setvar 'errno 0) (setq att (car (nentsel))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (null att) nil ) ( (/= "ATTRIB" (cdr (assoc 0 (setq atx (entget att))))) (princ "\nSelected object is not an attribute.") ) ( (prompt (strcat "\nUser selected attribute \"" (cdr (assoc 2 atx)) "\" with value \"" (cdr (assoc 1 atx)) "\" belonging to block \"" (cdr (assoc 2 (entget (cdr (assoc 330 atx))))) "\"." ) ) ) ) ) ) (princ) )
    1 point
  9. This suffix (setq new (strcat str suf)) (strcat c a) Prefix (setq new (strcat suf str)) (strcat a c) Yes you will need to do a question want suffix or prefix then an if and use correct Strcat order. Have a go only way to learn, we are here to help if you get stuck.
    1 point
  10. For it to work as you want need to pick the crossing objects one at a time, this way you get the end you want to put the label at. It depends on the direction of the crossing line so can not just "GET" the lines, in saying that, you can use the fence option to pick multiples in one go. Again that will imply which end to put label on. The end choice is done in the code. Try this (defun c:Findinters ( / obj obj2 pt pt2 len d1 d2 start end tmp ang) (defun _format ( n / nr ns i h) (setq head (cond ((setq h (nth (1- (setq i (strlen (setq nr (itoa (fix n)))))) '("00" "0" "")))(strcat "0+" h (rtos n 2 2 ))) ((strcat (substr nr 1 (- i 3)) "+" (substr (rtos n 2 2 ) (- i 3))) ) ) ) ) (defun rtd (a) (/ (* a 180.0) pi) ) ;; Make Readable - Lee Mac ;; Returns a given angle corrected for text readability (defun lm:makereadable (a) ((lambda (a) (if (and (< (* pi 0.5) a) (<= a (* pi 1.5))) (+ a pi) a ) ) (rem (+ a pi pi) (+ pi pi)) ) ) (setq obj (vlax-ename->vla-object (car (entsel "\nPick inter object ")))) (while (setq ent (entsel "\nPIck crossing object near end Enter to exit ")) (setq pt (cadr ent)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car ent))))) (setq obj2 (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj2)) (setq end (vlax-curve-getendPoint obj2)) (setq d1 (distance pt start)) (setq d2 (distance pt end)) (if (> d1 d2) (setq tmp start start end end tmp ) ) (setq pt2 (vlax-invoke obj2 'IntersectWith obj acExtendNone)) (setq len (vlax-curve-getDistAtPoint obj pt2)) (if (> d1 d2) (setq ang (angle (nth (- (length co-ord) 2) co-ord) (last co-ord))) (setq ang (angle (car co-ord) (cadr co-ord))) ) (setq ang (lm:makereadable ang)) (command "text" start 2.5 (rtd ang) (_format len)) ) (princ) )
    1 point
×
×
  • Create New...