Attribute ommiting prefix +

Hello,
i try to creat a little Attribute that displayes the Y Postion of a Block and all goes well.
I get this as Printout:
%<\AcObjProp.16.2 Object(?BlockRefId).InsertionPoint \f "%lu2%pr2%ds44%pt2">%
But when the Value is positive there is no positive prefix (+), only in negative Values. Is there a way to force this prefix or do i have to make 2 Blocks with differente Attirbutes, one with hard coded +
%<\AcObjProp.16.2 Object(?BlockRefId).InsertionPoint \f "%lu2%pr2%ps[+,]%ds44%pt2">%
and one without for the negative falue?

Is there a way to insert an if statment in this Command like : if: .InsertionPoint -> ps[+,]?

Thanks in advance
Mario

Comments

  • ALANH
    edited August 2022
    You can use diesel in a Field but that is about as far as I got. You should be able to do < 0 start googling I think its out there. I got the text to change set dimscale to 1 to test.

    "%<\\AcDiesel $(if,$(=,$(getvar,dimscale),1),full size)>%"

    "%<\\AcDiesel $(if,$(=,$(getvar,dimscale),1),full size,wrong size)>%"

    Doing some more testing when asked pick mtext object.

    (setvar 'useri2 20)
    (setq obj (vlax-ename->vla-object (car (entsel "Pick obj"))))
    (VLA-PUT-TEXTSTRING OBJ "%<\\AcDiesel $(+,$(GETVAR, USERI2), 1)>%")

    You should see 21.

    So should be able to do a IF < look at full or wrong above maybe substitute your /f so with +
    Would be easy to create 1000's of labels using lisp and just update.

    Last question if you never move the point then its easy to set the + using lisp. Personally avoid working with -ve only in Z working at sea level.