How to check current system variables of a dimension?

How to check current system variables of a dimension?

Anonymous
Not applicable
877 Views
2 Replies
Message 1 of 3

How to check current system variables of a dimension?

Anonymous
Not applicable

I am currently creating a macro which can add a "φ (FAI)" symbol at the start of a dimension, with a integer being inputted to represent how many of the same circle exist.

e.g. 3-φ6.000 = There a 3 circles, each with a diameter of φ3.000

 

The complete code I have is:

^C^C^P_userr1;0;_userr1;_non;\$m=$(if,$(getvar,userr1),_dimoverride;_dimpost;$(getvar,userr1)-%%c<>;;,_dimoverride;_dimpost;%%c<>;;)_single;^P

 

which works fine.

The problem I'm having is with the next code which adds full-width brackets on both sides. ( Full-width= (), half width = () ) 

which is as follows:

^C^C^P_dimoverride;dimpost;(<>);;single;^P

 

this, again works fine.

but the problem I've been having is that bracket code doesn't add but replaces the system variable with the brackets even if the φ symbol exist. Where as I want the φ symbol to stay with the brackets.

 

I.E: What I want:  3-φ6 -->  (3-φ6)

       What I get: 3-φ6 ----> (6)

 

How do I get the code to check the current system variable of a dimension has a φ symbol or not.?(If any other variable can be replaced with the brackets.)

 

Also, is a double If function OK in these kind of code?

 

Any help would be greatful.

Thank you.

0 Likes
Accepted solutions (1)
878 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant
Accepted solution

Hi

 

>>"How do I get the code to check the current system variable of a dimension"

 

Thats the proble, there is no systemvariable, it is a property of a dim.objects.

 

Without API programming you can not read the current value of object properties, not with DIESEL.

 

 

>"Also, is a double If function OK in these kind of code?"

 

So far the result is what you need, sure.

But what you try to do, you can not ask what what the current setting(value) is.

 

 

If you like, ask in LISP forum for help (to write a lisp solution)

Sebastian

0 Likes
Message 3 of 3

devitg
Advisor
Advisor

@Anonymous . 

For better understanding, and to get further help, please upload such sample.dwg

0 Likes