Jump to content
Developer Wiki and Function Reference Links ×

Can't add 'manual number' in 'space' by scrpit or in worksheet


Recommended Posts

Hello all,

 

I can't enter in a script a manual Number to 'Space'

here is my scrpit :

 

PROCEDURE test;

VAR
hDraw : Handle;

BEGIN
    BeginPoly;
        AddPoint(0, 0);
        AddPoint(0, 1000);
        AddPoint(1000, 1000);
        AddPoint(1000, 0);
    EndPoly;

    hDraw := CreateCustomObjectPath('space', LNewObj, nil);        
    SetRField(hDraw, 'space', '11_Number Style','Manual');
    SetRField(hDraw, 'space', '11_Space Name Cust', 'TheName');
    SetRField(hDraw, 'space', '11_Proposed Area',Num2Str(0,200));
    SetRField(hDraw, 'space', '11_Display Stamp','true');
    
    SetRField(hDraw, 'space', '11_Number','AA101');
    {this line is not process and event in a worksheet you can not ad manualy a text in field }
    
End;
RUn(test);

 

 

Is it a known bug?

Is there a other way to do it ?

 

Thank's for your help

Best day.

 

Link to comment

Multiple different issues. This version ALMOST works.

 

1.  You were setting the Number Style to 'Manual' instead of the required 'Label Text'.  I also moved this line to the bottom of the script.

2. Once you set the Number Style to 'Label Text' you have to store the value into the field 'NumberLabelText' instead of '11_Number'

 

3. This is where it ALMOST works.  The script below stores the proper values into the field, but the NumberLabelText does not display until you move (even a single pixel nudge is enough) the object. This has to occur (as best I can tell) OUTSIDE of the script.

 

I have tried ever permutation of Redraw, RedrawAll, ResetObject, HMove(hDraw, 0, 0) I can think of inside the script and it does not seem to make the value display until it is nudged or otherwise reset outside of the script.

 

A Move(0,0) outside of the script does for the reset. A Tools:Utilites:Reset All Plugins from the menu forces the redraw.

 

Hopefully @michaelk@MullinRJ@Sam Jones or one of the other terrific scripters here can point out what we are both missing.

 

 

PROCEDURE test;
VAR
hDraw : Handle;
BEGIN
    BeginPoly;
        AddPoint(0, 0);
        AddPoint(0, 1000);
        AddPoint(1000, 1000);
        AddPoint(1000, 0);
    EndPoly;
    hDraw := CreateCustomObjectPath('space', LNewObj, nil);
    
    ResetObject(hDraw);        

    SetRField(hDraw, 'space', '11_Space Name Cust', 'TheName');
    SetRField(hDraw, 'space', '11_Proposed Area',Num2Str(0,200));
    SetRField(hDraw, 'space', '11_Display Stamp','true');
    
    SetRField(hDraw, 'space', 'NumberLabelText','AA101');
	SetRField(hDraw, 'space', '11_Number Style','Label Text'); 
	
    {this line is not process and event in a worksheet you can not ad manualy a text in field }
	
End;
RUn(test);

 

Link to comment

I'm no help here, and have run into this problem several times.  In some commands, I have even thrown up an alert telling the user to nudge the object up and down to cause the OIP refresh.  It would be fantastic if someone can tell us how to guarantee the refresh of the OIP when Redraw, RedrawAll, ResetObject, HMove don't do the job.

Link to comment

Thanks @Pat Stanford

 

you give me the way

Now it's working if I do this

 

PROCEDURE test;
VAR
hDraw : Handle;
BEGIN
    BeginPoly;
        AddPoint(0, 0);
        AddPoint(0, 1000);
        AddPoint(1000, 1000);
        AddPoint(1000, 0);
    EndPoly;
    hDraw := CreateCustomObjectPath('space', LNewObj, nil);
    
    ResetObject(hDraw);        

    SetRField(hDraw, 'space', '11_Space Name Cust', 'TheName');
    SetRField(hDraw, 'space', '11_Proposed Area',Num2Str(0,200));
    SetRField(hDraw, 'space', '11_Display Stamp','true');
    SetRField(hDraw, 'space', 'NumberLabelText','AA101');
    SetRField(hDraw, 'space', '11_Number Style','Manual');
    
End;
RUn(test);

Edited by Platane
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...