Assembly Posted June 24, 2006 Share Posted June 24, 2006 Over the years I have scripted a number of PIO's. I have not been using UPI or IsNewCustomObject. In my limited knowledge of scripting, I know this is good practice, but unsure why. My plugins have preformed well and are stable. I am re looking at old scripts and upgrading some. I'm wondering if I should be working these functions in. If I should then some insight to how to use and where they sit within the structure of the PIO would be good. Quote Link to comment
ccroft Posted June 25, 2006 Share Posted June 25, 2006 The only time I use UPI calls is when I have constants that need to be adjusted for different document unit settings. I use IsNew only when I've got some logic branches that need to know if it's the first time the object has been inserted....usually to do with writing to records. Maybe your talking about the "standard regeneration" calls? The bit of voodoo that goes in part: objName:='Bad'; resultStatus:= GetCustomObjectInfo(objName,objHand,objRecHand,wallHand); IF resultStatus = TRUE and (objHand<>nil) ...etc Then run the script I've only used that when I need a handle to the PIO during creation. It goes at the top of the main block. In theory I guess it's also used as a guard against corruption or something. I've seen various opinions about wether it's really necessary. Some say it does no harm so go ahead and put it in there. So far with my stuff it's made no difference if a script has it or not. It would be great to have some definitive answer from Nemetscheck about this. What's the worst thing that can happen if you don't use it? Charles Quote Link to comment
Recommended Posts
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.