Code Red > AutoLISP (Vanilla / Visual)

AutoCAD Formula

(1/1)

mbrandt5:
While this is not an autolisp question, I know this group comes up with great autocad solutions so I figured it was worth a shot.
Has anyone worked with formulas in autocad blocks.  I am curious how to write a formula that can output a number based on the selected blocks visibility state names
Below are the variable formulas for the three blocks I want to reference, and there outputs are contact, motion detector, contact

%<\AcObjProp Object(%<\_ObjId 1960104872240>%).Parameter(7).VisibilityState>%
%<\AcObjProp Object(%<\_ObjId 1960104872432>%).Parameter(7).VisibilityState>%
%<\AcObjProp Object(%<\_ObjId 1960104872816>%).Parameter(7).VisibilityState>%

So "A" being contact and motion detector being "B", I am shooting for two formulas one that outputs 2 for A and one that outputs 1 for B

I am aware how I could create and process a list in several other languages, just not sure for block formulas.  If a similar formula is not available, any references to this language that go further than base equations (If possible) would be greatly appreciated.

ronjonp:
You could use a lookup table and and attribute like so. Although I'm not sure if this is exactly what you're asking.

MSTG007:
Pretty cool job.

mbrandt5:
Great suggestion though in my case not sure this would work as I have 20 blocks with two visibility states that are needing to be referenced.
so unfortunately that would be 2^20 = 1048576 different states.  That is why I am trying to learn the code...do not really want to but it seems like that is the viable solution in my case.

Navigation

[0] Message Index

Go to full version