Need lisp to label Dim-ordinates X and Y

Need lisp to label Dim-ordinates X and Y

Anonymous
Not applicable
1,453 Views
9 Replies
Message 1 of 10

Need lisp to label Dim-ordinates X and Y

Anonymous
Not applicable

I am looking for a LISP program that will allow me to select location to label dim-ordinates with arrows.AS PER THE ATTACHED DRAWING

0 Likes
Accepted solutions (2)
1,454 Views
9 Replies
Replies (9)
Message 2 of 10

ВeekeeCZ
Consultant
Consultant

Simplify the drawing to clearly see what you what. Where to click and what the result should be like.

I see no ordinate dims in the drawing.

0 Likes
Message 3 of 10

CADaSchtroumpf
Advisor
Advisor

Use a field !

for exemple for X,

((lambda ( / )
(entmake
'(
(0 . "SOLID")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "B2")
(62 . 1)
(100 . "AcDbTrace")
(10 371.634 45.8333 0.0)
(11 646.634 0.0 0.0)
(12 371.634 -45.8333 0.0)
(13 371.634 -45.8333 0.0)
(39 . 0.0)
(210 0.0 0.0 1.0)
))
(setq es (entlast))
(entmake
'(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "B2")
(62 . 1)
(100 . "AcDbLine")
(10 0.0 0.0 0.0)
(11 371.634 7.10543e-15 0.0)
(210 0.0 0.0 1.0)
))
(setq el (entlast))
(entmake
'(
(0 . "MTEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 4)
(100 . "AcDbMText")
(10 646.634 138.262 0.0)
(40 . 96.937)
(41 . 628.136)
(46 . 0.0)
(71 . 6)
(72 . 1)
(1 . "\\pxqr;0.000")
(7 . "Arial_1")
(210 0.0 0.0 1.0)
(11 1.0 0.0 0.0)
(42 . 326.782)
(43 . 98.9868)
(50 . 0.0)
(73 . 1)
(44 . 1.0)
))
(setq emt (entlast))
(vla-put-textstring (vlax-ename->vla-object emt) 
(strcat
"{\\fArial|b0|i0|c0|p34;"
"%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vla-get-ObjectID (vlax-ename->vla-object el)))
">%).StartPoint \\f \"%lu2%pt1%pr3\">%"
)
)
(setq js (ssadd emt (ssadd es (ssadd el (setq js (ssadd))))))
(sssetfirst nil js)
))

Move/Copy/Multiple this 3 entities and update field

0 Likes
Message 4 of 10

Anonymous
Not applicable

Attached revised drawing, I need X and Y values to be placed along arrows on clicking the desired location and placement of arrows automatically as well.

0 Likes
Message 5 of 10

Anonymous
Not applicable

Thanks , CADaStroumph But , I am novice and didn't understand the code ,Don't know how to use this.

0 Likes
Message 6 of 10

Anonymous
Not applicable

Attached revised drawing, I need X and Y values to be placed along arrows on clicking the desired location and placement of arrows automatically as well.

0 Likes
Message 7 of 10

CADaSchtroumpf
Advisor
Advisor
Copy-paste the code directely in your drawing ORDINATE DIMENSION WITH ARROWS1.dwg in command line. This create 3 object (solid, line and mtext with field) at origin point. They are gripped, select grip at base point, ans choose MOVE with option "copy" and place them where you want. Use after copy REGENALL for update the fields of your copy. Make the same objects for labelise Y coordinates
0 Likes
Message 8 of 10

Anonymous
Not applicable

I tried using code , X direction dimension is okay , Dimension in the y direction is also as X .this  y coordinates needs to be fixed .

All is good otherwise, attaching drawing.

Thanks 

0 Likes
Message 9 of 10

CADaSchtroumpf
Advisor
Advisor
Accepted solution

You don't have need a code for make this!

The code that i have proposed make only the objects, it can be draw manualy

Observe how this object is defined for make another one

 

But if you are tired; copy-paste.... for Y

((lambda ( / )
(entmake
'(
(0 . "SOLID")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "B2")
(62 . 1)
(100 . "AcDbTrace")
(10 -45.8333 371.634 0.0)
(11 3.95949e-14 646.634 0.0)
(12 45.8333 371.634 0.0)
(13 45.8333 371.634 0.0)
(39 . 0.0)
(210 0.0 0.0 1.0)
))
(setq es (entlast))
(entmake
'(
(0 . "LINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "B2")
(62 . 1)
(100 . "AcDbLine")
(10 0.0 0.0 0.0)
(11 1.56506e-14 371.634 0.0)
(210 0.0 0.0 1.0)
))
(setq el (entlast))
(entmake
'(
(0 . "MTEXT")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(62 . 4)
(100 . "AcDbMText")
(10 -138.262 646.634 0.0)
(40 . 96.937)
(41 . 628.136)
(46 . 0.0)
(71 . 6)
(72 . 1)
(1 . "{\\fArial|b0|i0|c0|p34;0.000")
(7 . "Arial_1")
(210 0.0 0.0 1.0)
(11 6.12323e-17 1.0 0.0)
(42 . 326.782)
(43 . 98.9868)
(50 . 1.5708)
(73 . 1)
(44 . 1.0)
))
(setq emt (entlast))
(vla-put-textstring (vlax-ename->vla-object emt) 
(strcat
"{\\fArial|b0|i0|c0|p34;"
"%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vla-get-ObjectID (vlax-ename->vla-object el)))
">%).StartPoint \\f \"%lu2%pt2%pr3\">%"
)
)
(setq js (ssadd emt (ssadd es (ssadd el (setq js (ssadd))))))
(sssetfirst nil js)
))
0 Likes
Message 10 of 10

Anonymous
Not applicable
Accepted solution

Thanks for the code, Works flawlessly.

0 Likes