joshtreverton Posted April 24, 2013 Share Posted April 24, 2013 Hi All, This might seem like a really easy question, however I will ask it anyway: I am using the RealDialog function to change the wall width of my a wall I am inserting the PIO in to (shown below) WallW:=RealDialog('The wall thickness must be either 100 mm. By changing the wall thickness this will remove the wall style. Please enter a new wall thickness.','100'); IF (WallW <> 100) THEN done:=TRUE; UNTIL (WallW = 100); IF NOT DidCancel THEN BEGIN WallBool := ConvertToUnstyledWall(wallHd); WallBool := DeleteAllComponents(wallHd); WallBool := SetWallThickness(wallHd, WallW); SetRFiel(PIOName,recname,'WallWidth',Num2Str(0,WallW)); END; If the end user presses cancel I want to be able to cancel the whole script and delete the PIO, which functions would I need to use to be able to do this? Thanks, Joshua Quote Link to comment
Miguel Barrera Posted April 24, 2013 Share Posted April 24, 2013 Use a menu or tool script instead to present the dialog and decide whether to insert or not the plugin. You cannot delete the plugin within its own script. If there was a need to delete a PIO, it would have to be done by an external script. You can insert a PIO with: FUNCTION CreateCustomObjectN (objectName : STRING; pX,pY : REAL; rotationAngle: REAL; showPref :BOOLEAN): HANDLE; Quote Link to comment
Hippocode Posted April 25, 2013 Share Posted April 25, 2013 so instead of deleting the plugin, you use the above mentioned code to place it ONLY if it meets your criteria. 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.