Thursday, March 27, 2025

FREELISP : Dimension align segment of polyline

             If user want to create dimension on each segment of polyline, try this LISP program

    Here is Video




Here is source code

(defun c:DimAll ( / ent entData vlist i pt1 pt2)  ; COMMAND is DIMALL
  (prompt "\nSelect Polyline to create dimension for each segment:")
  (setq ent (car (entsel)))
  (if (and ent
           (= (cdr (assoc 0 (setq entData (entget ent)))) "LWPOLYLINE"))
    (progn
      ;; create list of  Polyline vertex
      (setq vlist '())
      (foreach x entData
        (if (= (car x) 10)
          (setq vlist (append vlist (list (cdr x))))
        )
      )
      ;;  Polyline check
      (if (= (logand (cdr (assoc 70 entData)) 1) 1)
        (setq vlist (append vlist (list (car vlist)))) ; if closed, add last point
      )
      ;; Loop create DIMALIGNED each segment
      (setq i 0)
      (while (< (1+ i) (length vlist))
        (setq pt1 (nth i vlist))
        (setq pt2 (nth (1+ i) vlist))
        (command "_.DIMALIGNED" pt1 pt2 pause) ; pause = wait user place dim line
        (setq i (1+ i))
      )
    )
    (prompt "\nselected not  Polyline")
  )
  (princ)

Wednesday, March 19, 2025

Using Xref to Save Time from Repetitive Editing

 Using Xref to Save Time from Repetitive Editing

    Normally, in drafting, there are often repeated elements within the same drawing. For example, in the floor plans of buildings like dormitories, apartment complexes, or condominiums, the room layouts are typically identical across floors. Depending on the project, there may be many identical room types. If there is a need to modify any one of these rooms, the drafter must manually update every instance of that room type. 

    For example, if the door size is changed in one type of room, the drafter must update the door size in all similar rooms, which can be very time-consuming.

    In PTCAD, there is a command called Xref (short for external reference), which allows you to create a prototype of an object and reuse it throughout the drawing. When the original reference is updated, all the referenced instances in the drawing will be automatically updated accordingly. Xref links information from an external file. In this example, we use the Xref command to place multiple sanitary fixtures in a building's bathroom.

Steps:

  1. Type the command XREF. A dialog box will appear

  2. Click the Attach button and select the file you want to insert.

  3. Click OK, then place the file at the desired location (similar to placing a block).


  4. Use the Copy command to place it in other positions.

  5. To edit an existing Xref file (e.g., replacing squat toilets with flush toilets), run the XREF command again.

  6. At Ref Path.   Click the Browse button to select a new file, then click OK. All instances of the sanitary fixtures in the drawing will be updated to the newly selected mode.

Additional Information:

  • The Reference Name is automatically set based on the name of the first Xref file. You can rename it by clicking the name once to enter rename mode.

         

Draw mechanical details with PTCAD Plus - MEC

     Draw mechanical details with PTCAD Plus - MEC               PTCAD Plus edition contains many plug-ins  AECplus, MEC, Assetlink which ca...