Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/16/2025 in all areas

  1. Just use a point and insert Field in Mtext and format it how you want. When copying both point and text it will keep the new copied items linked. Regen to update the coordinates.
    1 point
  2. You can also use fields with selection of points? (defun make_field (ent / pt obj) (setq pt (trans (cdr (assoc 10 (entget ent))) 1 0)) (mapcar '(lambda (lx) (apply '(lambda (ins_point value_field att_point txt_height dwg_dir name_layer txt_rot / nw_obj) (setq nw_obj (vla-addMtext Space (vlax-3d-point (trans ins_point 1 0)) 0.0 (strcat "{\\f@Arial Unicode MS|b0|i0|c0|p34;\\Q15;" "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-ObjectID (vlax-ename->vla-object ent))) value_field "}" ) ) ) (mapcar '(lambda (pr val) (vlax-put nw_obj pr val) ) (list 'AttachmentPoint 'Height 'DrawingDirection 'InsertionPoint 'Layer 'Rotation) (list att_point txt_height dwg_dir ins_point name_layer txt_rot) ) ) lx ) ) (list (list (mapcar '+ (trans pt 1 0) (list (getvar "TEXTSIZE") (+ (* (getvar "TEXTSIZE") 1.25) (getvar "TEXTSIZE")) 0.0)) ">%).Coordinates \\f \"%lu2%pt1%pr3%ps[X:,]\">%" 4 (getvar "TEXTSIZE") 5 "Id-XY" rtx ) (list (mapcar '+ (trans pt 1 0) (list (getvar "TEXTSIZE") 0.0 0.0)) ">%).Coordinates \\f \"%lu2%pt2%pr3%ps[Y:,]\">%" 4 (getvar "TEXTSIZE") 5 "Id-XY" rtx ) (list (mapcar '- (trans pt 1 0) (list (- (getvar "TEXTSIZE")) (+ (* (getvar "TEXTSIZE") 1.25) (getvar "TEXTSIZE")) 0.0)) ">%).Coordinates \\f \"%lu2%pt4%pr3%ps[Z:,]\">%" 4 (getvar "TEXTSIZE") 5 "Id-Z" rtx ) ) ) ) (defun c:point-xyz_field ( / htx rtx AcDoc Space ncol ss n) (initget 6) (setq htx (getdist (getvar "VIEWCTR") (strcat "\nSpecify the height of the field <" (rtos (getvar "TEXTSIZE")) ">: "))) (if htx (setvar "TEXTSIZE" htx)) (if (not (setq rtx (getorient (getvar "VIEWCTR") "\nSpecify the orientation of the field <0.0>: "))) (setq rtx 0.0)) (vl-load-com) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ncol '(96 174) ) (foreach n '("Id-XY" "Id-Z") (cond ((null (tblsearch "LAYER" n)) (vlax-put (vla-add (vla-get-layers AcDoc) n) 'color (car ncol)) ) ) (setq ncol (cdr ncol)) ) (while (null (setq ss (ssget '((0 . "POINT")))))) (repeat (setq n (sslength ss)) (make_field (ssname ss (setq n (1- n)))) ) (prin1) )
    1 point
  3. I tested the code. All the points are equidistant, but there are two long segments where the equidistance is drastically broken. In the last screenshot Dexus attached, you can see approximately where the center line should be in that area. The center line returned by the GLAVCVS code is shown in magenta. And the approximate location where it should be is shown in red. I've attached an image of this
    1 point
×
×
  • Create New...