Showing results for 
Search instead for 
Do you mean 
Reply

PostBuilder 9 Disable all syntax checking

Is it possible to disable Postbuilders code checking it drives me nuts.

 

 In "Options" -> "Validate Custom Comands" I have everything deselected.

 

When I insert this code into a custom command I get the error below.

 

I know this works as I use it in sourced tcl in other posts.

 

Any ideas please.

 

global mom_seqnum

    if {[info exist mom_seqnum]} {
        set seq_mag [expr {pow(10,floor(log10($mom_seqnum)))}]
        set seq_mag [format "%0.f" $seq_mag]
        #MOM_output_to_listing_device "$seq_mag"
    }

 

---------------------------
Custom Command Error
---------------------------
Error found in "PB_CMD_first_tool" :

expected floating-point number but got "pow(10,floor(log10($mom_seqnum)))"
while executing
"format "%0.f" $seq_mag"
invoked from within
"if {[info exist mom_seqnum]} {
set seq_mag 0.0
set seq_mag [expr {pow(10,floor(log10($mom_seqnum)))}]
set seq_mag [format "%0.f" $seq_mag]
} else {
se..."
("eval" body line 5)

12 REPLIES

Re: PostBuilder 9 Disable all syntax checking

[ Edited ]

On Further checking I found removing the braces from the expr  line works.

 

However

 

In the TCL manual on "expr" it states

 

PERFORMANCE CONSIDERATIONS

Enclose expressions in braces for the best speed and the smallest storage requirements. This allows the Tcl bytecode compiler to generate the best code.

 

so my code is more correct but fails Postbuilders checking.....

Re: PostBuilder 9 Disable all syntax checking

I don't think they meant curly braces, just regular ones.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: PostBuilder 9 Disable all syntax checking

I'm not sure about that.

 

from wiki http://en.wikipedia.org/wiki/Bracket

 

( ) — parentheses, brackets, round brackets, soft brackets, or circle brackets
[ ] — square brackets, closed brackets, hard brackets, or brackets (US)
{ } — braces (UK and US), flower brackets (India), French brackets, curly brac

 

I have tested this in a post I did years ago that was doing heaps of vector calcs for point reduction for our robots.

adding the Braces (Curly Brackets) reduced the run time by a huge factor

 

http://community.plm.automation.siemens.com/t5/NX-CAM/TCL-3-5-times-faster/m-p/219614/highlight/true...

 

 

The new ugpost_base_math.tcl has "braces"

 

 

set PI      [expr {2.0 * asin(1.0)}]               ; # Value of PI
set RAD2DEG [expr {90.0 / asin(1.0)}]              ; # Multiplier to convert radians to degrees
set DEG2RAD [expr {asin(1.0) / 90.0}]              ; # Multiplier to convert degrees to radians

Re: PostBuilder 9 Disable all syntax checking

 Here is the results from the test I did laid out better

As you can see adding the braces reduced the time by at least 70%

 

rev1.tcl was using standard ug_post_base.tcl with braces added 

rev2.tcl was reducing looping and calls to other procs

 

 

sourceugs.tclrev1.tclrev2.tcl
 microseconds 
VEC3_add1343
VEC3_cross1844
VEC3_dot "diff"922
VEC3_dot "same"922
VEC3_is_zero "false"732
VEC3_is_zero TR1574
VEC3_mag "non zero"1333
VEC3_mag zero"1133
VEC3_negate832
VEC3_scale1342
VEC3_sub1343
VEC3_unitize "non zero"42129
VEC3_unitize "zero"1786
USER_dist_point_line8723

19

USER_angle_3points812319

 

 

Re: PostBuilder 9 Disable all syntax checking

A developer just tried this, and he can’t duplicate the problem in PB 9, 901, 902 or 903.

If it's a problem for you, please log a call with GTAC.

Mark Rief
Retired Siemens

Re: PostBuilder 9 Disable all syntax checking

The code looks legit and should have worked. If I just copy & paste your code fragment (in the shaded box) into a custom command, the code survived the checking in PB9, 9.01 & 9.02. And also the message below the header "Custom Command Error" looks different from what's in the shaded box. Perhaps, some "details" got left out of the message that you posted here.

Re: PostBuilder 9 Disable all syntax checking

not sure whats going on,

 

Post Builder 9.0.2

 

New 3-axis mill metric generic

 

create new custom comand

paste code

 

global mom_seqnum

    if {[info exist mom_seqnum]} {
        set seq_mag [expr {pow(10,floor(log10($mom_seqnum)))}]
        set seq_mag [format "%0.f" $seq_mag]
        #MOM_output_to_listing_device "$seq_mag"
    }

error

 

---------------------------
Custom Command Error
---------------------------
Error found in "PB_CMD_seqno_mag" :

expected floating-point number but got "pow(10,floor(log10($mom_seqnum)))"
while executing
"format "%0.f" $seq_mag"
invoked from within
"if {[info exist mom_seqnum]} {
set seq_mag [expr {pow(10,floor(log10($mom_seqnum)))}]
set seq_mag [format "%0.f" $seq_mag]
}"
("eval" body line 2)

---------------------------
OK
---------------------------

Re: PostBuilder 9 Disable all syntax checking

Interesting.

 

I tried this on another computer and no error.

 

 

Re: PostBuilder 9 Disable all syntax checking

delete all file in %TEMP%

 

no error

Learn online





Solution Information