Print Page | Close Window

Assign a variable instead a numerical value

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=9258
Printed Date: 20.May.2026 at 14:33


Topic: Assign a variable instead a numerical value
Posted By: Silvia_sds
Subject: Assign a variable instead a numerical value
Date Posted: 30.May.2013 at 19:51
Hi everyone, I have a question about AutoCAD 2013: is it possible to assign a variable (for example to a line) instead a numerical value? So I'll be able to change it whenever I want without extend or trim lines.
Thank you



Replies:
Posted By: Vladimir Michl
Date Posted: 31.May.2013 at 07:57
What is a "numerical value" of a line? Do you mean its length, or XData record, or some kind of a label?
For length, you can use AutoCAD parametric functions (see the Parametric ribbon).

-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: Kent Cooper
Date Posted: 31.May.2013 at 14:24
I'm not quite sure I understand exactly what you mean, either, but is something like LENGTHEN with the Total option what you want to do?  You could build a function that would feed a variable into that for the total length, and leave the User to select Lines they want to be that length:
 
(command "_.lengthen" "_total" YourVariableValue)


Posted By: CarlB
Date Posted: 31.May.2013 at 22:33
If you did this, how would the changed variable know which end of the line to change, or if both?


Posted By: heinsite
Date Posted: 02.Jun.2013 at 09:32
With parametric constraints AutoCAD knows which direction a line was drawn so it will know which end to modify.  In this case however what the OP is calling a variable would actually involve changing a constant (line length).

Dave.


-------------
Dave Hein, P.E.
Hawaii District Engineer
Kona International Airport
AutoCAD Certified Professional
Autodesk Expert Elite


Posted By: Kent Cooper
Date Posted: 03.Jun.2013 at 15:02
CarlB wrote:
If you did this, how would the changed variable know which end of the line to change, or if both?

Lengthen with the Total option just moves the end nearer where you pick the object, leaving the other end in place.  [I don't have a new-enough version to have constraints, which may affect that.]  The variable would only be a number representing the desired length, though we still haven't heard from the OP about whether that's what is meant in their question.



Print Page | Close Window