Yancka Posted April 21, 2010 Share Posted April 21, 2010 If several instances of my custom made PIO are selected and some parameters are changed to all selected instances simultaneously the following issues appear: 1. In OIP all parameters are visible and are enabled. 2. Only 1 PIO is OK, others are kinda broken until some parameter of specific PIO instance is changed. 3. In the schedule (quickest method to check this is to create a report) sizes are OK only to this 1 PIO. If working with 1 only PIO everything looks just fine. Problem persists only if working with 2 or more PIOs and they are standard size (Standard size parameter is unchecked). Would there be a problem with logics of how I've made up setting standard sizes? Or would the problem be in function I use to retrieve object handle (FSactLayer) and the solution would be to foresee possibility of multiple selection and then cycle through selection set? If last one seem to be correct, pls give some hint on how to include such cycle into code of PIO. Here's the code of simple plug-in I wrote to check this: PROCEDURE Quadrilateral; VAR RectWidth, RectHeight :REAL; PluginHandle :HANDLE; BEGIN RectWidth:=PBox_Width; RectHeight:=PBox_Height; PluginHandle:=FSactLayer; IF PCustom_size=false THEN BEGIN EnableParameter(PluginHandle,'Box Width',false); EnableParameter(PluginHandle,'Box Height',false); IF PQuadrilateral_type='Square' THEN BEGIN IF PSquare_standard_size='A1' THEN RectWidth:=350; IF PSquare_standard_size='A2' THEN RectWidth:=680; IF PSquare_standard_size='A3' THEN RectWidth:=975; END; IF PQuadrilateral_type='Rectangle' THEN BEGIN IF PRectangle_standard_size='T1' THEN BEGIN RectWidth:=350; RectHeight:=680; END; IF PRectangle_standard_size='T2' THEN BEGIN RectWidth:=680; RectHeight:=975; END; IF PRectangle_standard_size='T3' THEN BEGIN RectWidth:=975; RectHeight:=1550; END; END; END ELSE BEGIN EnableParameter(PluginHandle,'Square standard size',false); EnableParameter(PluginHandle,'Rectangle standard size',false); END; IF PQuadrilateral_type='Rectangle' THEN SetParameterVisibility(PluginHandle,'Square standard size',false) ELSE BEGIN SetParameterVisibility(PluginHandle,'Rectangle standard size',false); EnableParameter(PluginHandle,'Box Height',false); RectHeight:=RectWidth; END; SetRField(PluginHandle,'2D Quadrilateral','Box Width',Num2Str(0,RectWidth)); SetRField(PluginHandle,'2D Quadrilateral','Box Height',Num2Str(0,RectHeight)); MoveTo(-RectWidth/2,0); Rect(-RectHeight,#90,RectWidth,#0); END; Run(Quadrilateral); Quote Link to comment
JBenghiat Posted April 21, 2010 Share Posted April 21, 2010 Yancka, I think the problem is that your code uses FSActLayer to get a handle to itself. Instead, use GetCustomObjectInfo, which gets a handle to the PIO associated with it's obj info parameters. Here's my basic code framework: VAR PIHan :HANDLE; {handle to Plug-In} PIRecHan :HANDLE; {Handle to Plug-In Record} PIWallHan :HANDLE; {Handle to wall containing Plug-In} PIName :STRING; {Name of Plug-In definition} BEGIN IF GetCustomObjectInfo(PIName,PIHan,PIRecHan,PIWallHan) THEN BEGIN {--- Regen Code Here ---} END; END; -Josh Quote Link to comment
Yancka Posted April 21, 2010 Author Share Posted April 21, 2010 Josh, GetCustomObjectInfo seem to solve all my issues regarding this. Many thanks for your advise! 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.