John Gr Posted February 17, 2008 Share Posted February 17, 2008 (edited) Hi there Is it possible to edit PIO Parameter values attached to a Document using script. I would like to be able to set default PIO values to a number of PIOs using a script and to delete old PIO records stored in a document. At the moment before i place a PIO onto a design layer i edit the parameter values manually from the tool bar. John BTW -- Havent sorted Parameter sort order yet. Edited February 17, 2008 by John Gr Quote Link to comment
Dieter @ DWorks Posted February 18, 2008 Share Posted February 18, 2008 You can set the default values of pio's withouth a script, just go to the VS plug-in editor, and choose parameters. Here you can set those defaults, you can even give them other names to show in the oip. Quote Link to comment
John Gr Posted February 19, 2008 Author Share Posted February 19, 2008 Hi there I am wanting to write a script that can setup a whole group of PIO with the defalts i enter. The PIOs are roof framing members. I would like to set the defaults for timber treatment, roof pitch, timber sizes, soffit overhangs, etc. etc. Currently i do the above from the tool bar on each object. Quote Link to comment
Pat Stanford Posted February 19, 2008 Share Posted February 19, 2008 Can be done fairly simply, but not easily. You will need to write a custom dialog box to collect the data. Then you will use the SetRField command to store the data to the PIOs. Also of concern is how to identify the PIO to store the data to. Easiest would be if you always wanted to do every PIO of a certain type in the drawing. Second easiest would be to select the PIOs and store it to the selected PIOs. The hard part will be creating the custom dialog. You probably want to make this a Plug-in Menu Command so that the data fields can have default values stored between executions. Also, a comment on DWorks idea. Yes, you can change things in the Plug-In editor, but they are likely to be undone the next time you upgrade. Certainly will have to be redone at the next major version, and possibly at the next service pack. Nothing wrong with making changes, but you should have a heads up about the longevity of the changes. Pat Quote Link to comment
John Gr Posted February 19, 2008 Author Share Posted February 19, 2008 Hi Pat Thanks for your posting. My aim is to edit the default Object Proprties values stored on a templet i have opened. You may know that the last values are saved in a document using the Object Properties Dialog. To view the record names in a documnet open a blank templet then create a report. (These records remain even if all of the Objects are deleted from the curent document.) Select 'list all objects with records'. You will see a list of PIO records that have been placed on that saved Document in the passed. I would like to be able to have access to those values stored in these records and to have the ability to change their values. I have developed a script that imports values from a roof truss layout and design program and sets up a new VW drawing. Title block info etc. There is abaout 5 PIOs that i have created to finish off a truss layout and that produces cutting sheets for ( Balance of Roof )rafters, cut soffit members, valley boards, Beams etc. When i select the say rafter PIO it will already have the Pitch, timber species, grade, treatment, etc. vrs setting values in the Object Properties Dialog before object is placed on drawing. I hope this makes sense. I am not the best at explaining things. Cheers John Greaney ( Note: The Record is created when you first place a new PIO on a drawing. The Object Properties dialog box is shown. ) Quote Link to comment
Pat Stanford Posted February 20, 2008 Share Posted February 20, 2008 This post is from the VectorScript mail list a couple of years ago. It should give you the information you need to set the PIO defaults. If you have questions, please let me know. Pat Subject: Re: Can't SetRField from one Menu PIO to another Menu PIO From: benghiat@________.NET Date: May 8, 2006 7:11:13 AM PDT Also, the only way for a user to see the parameters is to go in through Create Script, and that will only show you the defaults. If you want the user to access the record attached to the menu directly, you will have to create a custom dialog. One caveat to remember is that you have to run the menu in each document before its record and parameters are created. This means that if you run the second menu command first, you will get an error. The only way to create the menu's record is to run the menu item--you can't force the record creation with NewField(). For this reason, it's often best to only use menu parameters that are used by that menu object. For global preferences, create a normal record and make it invisible with: SetObjectVariableBoolean(handleToDataRecordFormat, 900, FALSE); The record's default values become your "preferenes," and you can get the handle to the default record with GetObject ('DataRecordFormatName') for a record named DataRecordFormatName. Quote Link to comment
Dieter @ DWorks Posted March 23, 2008 Share Posted March 23, 2008 But the question remains: 'How can you set the default values for a pio?' (Those that are saved with the document and that you can change through the mode bar) Quote Link to comment
John Gr Posted March 25, 2008 Author Share Posted March 25, 2008 Yeah :-} Soooo Simple.... Very Simple answer to my original posting. create a handle to the plugin using GetObject. Use setRfield to set preferences. BorSLH := GetObject('jg-BOR SL~'); { Handle to Plugin Object } ....................... ........................ ........................... default := concat(Num2Str(2,str2Num(pitch[k]))); Entry := StrDialog('Enter Pitch',default); if didCancel then GOTO 100; SetRField(BorSLH, GetName(BorSLH),'Roof Pitch',concat(Entry)); { Object Preference set from entry StrDialog on current Document } Quote Link to comment
Dieter @ DWorks Posted March 25, 2008 Share Posted March 25, 2008 I found it out yesterday, It's simple but very small to overlook it. It's one of those things you have to just know. 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.