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.
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).
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.
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.