Punch! CAD 
 »  
ViaCAD & Shark 
 »  
General 
 »  
Question on Expression Parser VIACad V6 Build 784 (#1784) 
 
 
        
            
            
    
        
Rank: Junior Member
Joined: 11/20/2007(UTC) Posts: 17
 
     
    
        
            
	      
                The description of the expression parser indicates a value  can be a param .  Further, a param  is defined as an alpha  with an optional integer  (e.g. A, b2, etc.).   I use the expression parser quite a bit and I was hoping that param  might offer a way to access data from an existing object (length, diameter, etc.).  As far as I can see, not so.   Absent any example of using a param  in an expression,  I can't figure out what param  really evaluates to.  If, for instance, you enter A1 in a data entry field, V6 returns an error message.
            
  
         
     
 
    
        
            
     
    
        
            
        
     
 
    
        
     
 
            
        
            
        
            
            
    
        
Rank: Senior Member
Joined: 2/2/2007(UTC)
Posts: 5,450
Was thanked: 508 time(s) in 354 post(s)
 
     
    
        
            
	      
                >>way to access data from an existing object (length, diameter, etc.).    Unfortunately no.  I've been looking for a way to tie attributes to the constraint variables (like height of an extrusion). >>I can't figure out what param  really evaluates to.    Perhaps below will help. There is also a param, const, and macro interface. In any numeric input field you can enter a new definition as follows: @param=expression  This format creates a param value. The value of param is evaluated at the time it is created. It will not change value until a replacement is entered.  @const=#expression  This format creates a const value. The value of const is evaluated at the time it is created. Once created, a const cannot be replaced (unless you hand edit the prefs\UserMacros.ini file).  @macro=@expression  This format creates a macro value. The value of macro is evaluated each time it is referenced. Hence, its value can change over time as any param or const values are updated. For example, in an input field enter: @a=5// param a has the value 5.0 @B=#a*2// const B has the const value of 10.0 @M=@rnd(a)// macro M will be a random number between 0 and a You can use a, B, or M anywhere the expression syntax allows a value! So for a line's length you could now enter M+5 and the line's length would end up being some value between 5 and 10 (=5+a). If you then re-entered @a=10, and then entered M+5 as the line's length again, it would end up being some value between 5 and 15 (=5+a).
    Tim Olson  IMSI Design/Encore
 
            
 
        
    
 
    
        
            
     
    
        
            
        
     
 
    
        
     
 
            
        
    
        
            
            
    
        
Rank: Junior Member
Joined: 11/20/2007(UTC) Posts: 17
 
     
    
        
            
	      
                Tim,  Thanks.  The info will come in handy.  Its a lot easier to remember (and enter) A1 instead of .066623 Eradley ham
            
  
         
     
 
    
        
            
     
    
        
            
        
     
 
    
        
     
 
            
        
            
        
            
            
    
        
Rank: Junior Member
Joined: 11/20/2007(UTC) Posts: 17
 
     
    
        
            
	      
                Tim, Thank you.  The information will be very handy. Its easier to remember (and enter) A1 than .06662 for instance. E. Ham
            
  
         
     
 
    
        
            
     
    
        
            
        
     
 
    
        
     
 
            
        
    
        
            
            
    
        
Rank: Senior Member
Joined: 2/2/2007(UTC)
Posts: 5,450
Was thanked: 508 time(s) in 354 post(s)
 
     
    
        
            
	      
                Yes.  Once you define a constant, it will be remebered as it is stored in an ini file for later launches. Tim
    Tim Olson  IMSI Design/Encore
 
            
 
        
    
 
    
        
            
     
    
        
            
        
     
 
    
        
     
 
            
        
    
                           
Punch! CAD 
 »  
ViaCAD & Shark 
 »  
General 
 »  
Question on Expression Parser VIACad V6 Build 784 (#1784) 
 
    
        Forum Jump
         
Punch! CAD 
  ViaCAD & Shark 
   - News and Announcements 
   - General 
   - 2D Drafting 
   - Surface Modeling 
   - Solid Modeling 
   - Subdivision Modeling 
   - Rendering & Display 
   - Import/Export 
   - Tips and Tutorials 
   - Suggestions 
   - Gallery 
   - PowerPack 
   - Punch Lounge 
 
    
    You cannot  post new topics in this forum.
 
You cannot  reply to topics in this forum.
 
You cannot  delete your posts in this forum.
 
You cannot  edit your posts in this forum.
 
You cannot  create polls in this forum.
 
You cannot  vote in polls in this forum.