Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Function to Convert Position(X,Y) to Rung Number

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
240 Views, 3 Replies

Function to Convert Position(X,Y) to Rung Number

I'm trying to figure out a clean way to use a Field to address the location (Rung Number).  I noticed my Rung Number is -2*y+iif(pgB,20,0)    PgB and Page number could be in a lookup table, or probably an equation if I thought harder.

 

Is there a way to make this a reusable formula so its easy to as InsertField?   GetRung(<Object>.Location()) for example.

3 REPLIES 3
Message 2 of 4
steven-g
in reply to: Anonymous

Unfortunately without a .dwg to see how this is used your description is a bit unclear (to me), LT cannot store user-defined functions, maybe putting the formula into a block will make it reusable, but that does depend on what you are trying to do (this is where you need to post a .dwg highlighting what you are trying to do).

Message 3 of 4
Anonymous
in reply to: steven-g

I dont know what I would show in an example dwg.

A block has a Field Position.  I'm trying to easily/reusably convert that Postion to a number.

 

GetRung(Object.Position as Pos)= Pos.X*1000+(Pos.Y*-2) 

It could be that simple. But its not that simple, so I don't want to keep copy pasting "Object.Position.X*1000+(Object.Postion.Y*-2)".  I want to do GetRung(Object.Position) and be done. It would be used 100s of times.

 

Maybe custom functions don't exist. I can't seem to find anything on it and figured I was just not using the correct terms.

Message 4 of 4
pendean
in reply to: Anonymous

Looks like you need to be using AutoCADMEP or AutoCADELECTRICAL variants, not low end LT (or plain full AutoCAD without 3rd party customizations). LT (and plain AutoCAD) have no concept of RUNG, that means nothing in the two programs.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Technology Administrators