AutoCAD/Please Help Me..

Advertisement


Question
In AutoCAD Can we give offset value of a line, there also place value of the offset distance (offset value place as text on line) ??

Answer
Hi Raj,

I think the below solution will help you to create the offset the line and place the annotaion on the line

please cppy the code and paste in the autocad command prompt and enter the command oft and follow the prompts.


(defun c:OFT ()
   (cond ((and   (setq selObj (car (Entsel "nSelect Entity To Offset:")))
     (Setq pickSide (getpoint "nPick Side To Offset:"))
     (setq offDist (getreal "nEnter Offset Distance:"))
     )
     (Setq prevOne (entlast))
     (vl-cmdf "offset" offDist selObj pickSide "")
     (cond ((And (Setq entlst (entlast)) (/= prevOne entlst))
       (setq entobj (vlax-ename->vla-object entlst))
       (Setq annPt (vlax-curve-getpointatparam entobj (* (vlax-curve-getendparam entobj) 0.5)))
       (Setq   segAngle (angle   annPt
         (vlax-curve-getpointatparam entobj (1+ (fix (vlax-curve-getparamatpoint entobj annPt))))
         )
       )
       (vl-cmdf "text" annPt offDist (* (/ 180 pi) segAngle) (rtos offDist 2 2))
      )
     )
    )
   )
   (princ)
 )

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ramanjaneyulu .J

Expertise

Any doubts bound to AutoCAD Customization with AutoLISP, VLISP, VBA, Objectarx and also with C#

Experience

I hold experience in the GIS industry in delivering the customized breakthroughs for the below products. AutoCAD AutoCAD Map AutoCAD Overlay

Organizations
Cyient(Infotech Enterprises Ltd) (Current) Avineon India Pvt Ltd DSM soft Alcor Technologis Pvt Ltd

Education/Credentials
Diplioma in Mechanical Engineering

©2016 About.com. All rights reserved.