Jump to content

MullinRJ

Member
  • Posts

    2,013
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. I'm guessing here, but you may need to enable something before it will work. Do you have this turned on? result := SetObjPropVS(kObjXPropAcceptStates, TRUE); { 18 } Set it in the kObjOnInitXProperties event. { event 5 } I've found that many events can be hidden from your code if they are not properly enabled first. If it's not this, it may be something else. Raymond
  2. Look at this command WidgetChanged := vsoStateGetParamChng(PIOHand, WidgetID, WidgetIndex, OldSel); I use it in the kResetEventID { 3 - Object reset has been called } event. Raymond
  3. Short answer - YES. I'll have to look up the way as I don't remember exactly what changes off the top of my head. Raymond
  4. To duplicate a view that was previously saved, use VRestore() with the name of a previously saved view, make any changes you want to the now-current view, then use VSave() with a new name to save the modified view. There is no way to edit the attributes of a saved view entity, just save a newly modified view under a new name. If you want to return to the view you had just before the edits, try this: VSave('This view'); { temporary view } VRestore('An Existing View'); ... { make all desired changes to the view HERE. } ... VSave('A New View'); { based on An Existing View } VRestore('This view'); VDelete('This view'); { clean up named view clutter } HTH, Raymond
  5. Modern Dialog StaticText colors are OUT, tints are IN. In VW 2023, SetStaticTextColorN() was introduced to replace SetStaticTextColor(), which failed in VW 2020 on the Mac (VB-160901), and StaticText now receives discrete TINTS, and not the full range of colors that could be generated with the older SetStaticTextColor(). In exploring the available tints, I found some shortcomings. 1) There is no BLUE (203). The index assigned to blue actually generates a color close to cyan. 2) PINK (208) is not a distinct color. It looks exactly like RED (200). 3) MAGENTA is missing from the list. Is this what PINK (208) was supposed to be? The 3 primary colors (RGB) and the 3 secondary colors (CMY) should be represented. Currently we have (RG and CY). Here is a screenshot of a test dialog. I reviewed the output on two monitors with very different color balances and the tints have the same appearance on both monitors. I have not tried this on a Windows machine. I do like the Orange (204), Purple (207), and Gray (209) shades. Brown (206) and Yellow (205) are hard to see against the gray background of the dialog. The older command, SetStaticTextColor(), was much more flexible in that I could tweak the RGY color components to get a shade that had good hue and good contrast. The current tints leave a lot to be desired. If I could request additional shades, I would like darker versions of Red, Green (especially), and Blue. Is this even possible? If anyone wants the code for this dialog, just ask. I'll be happy to send it to you. Raymond
  6. I take the previous post back. If that were the case, it would purge. So it is attached to something. Probably a resource and not an object. Raymond
  7. @Pat Stanford, this is hypothetical, but if you had the equivalent of the following occur in the import process you would have a 'BoB' class created with no object(s) associated with it. NameClass('BoB'); NameClass('Boundary'); Rect(0, 11, 15, 0); NameClass('None'); { return to default class } Perhaps it comes about like this: NameClass('BoB'); { object is omitted from export, but not before its class is defined } NameClass('Boundary'); Rect(0, 11, 15, 0); NameClass('None'); { return to default class } Raymond
  8. If a function doesn't exist, you can always create a lookup function for the typical values you find in Imperial Scales. Something like this: def ImpScale(SF): # return the imperial scale string for typical Layer Scale Factor values (SF) if SF == 4: return '3"' elif SF == 6: return '2"' elif SF == 8: return '1-1/2"' elif SF == 12: return '1"' elif SF == 16: return '3/4"' elif SF == 24: return '1/2"' elif SF == 32: return '3/8"' elif SF == 48: return '1/4"' elif SF == 64: return '3/16"' elif SF == 96: return '1/8"' elif SF == 192: return '1/16"' elif SF == 384: return '1/32"' elif SF == 120: return '1"='+"10'" elif SF == 240: return '1"='+"20'" elif SF == 360: return '1"='+"30'" elif SF == 480: return '1"='+"40'" elif SF == 600: return '1"='+"50'" elif SF == 1200: return '1"='+"100'" else: return '1:'+str(SF) SF = 1 while not vs.DidCancel(): SF = vs.IntDialog( 'Enter a scale factor', str(SF)) if not vs.DidCancel(): vs.AlrtDialog(ImpScale(SF)) # test the function Raymond
  9. Hello @Lunar Waneshaft, Forgive me if I don't quite understand the question, so let me try to answer what I think you're asking. If you change the angle between the sides, you are effectively changing the number of sides around the circle. So at 10° between segments you have 36 sides, changing it to 7.5° will give you 360°/7.5°, or 48 sides. You can put 360/7.5 in the first field (# Sides) and 4800mm in the third field (Side Len), and click on the Apply button. Reshaper will calculate the number sides from the expression "360/7.5" and round the result to the nearest integer value. If you check the "Constant side length" checkbox, you can then change other fields and Reshaper will recalculate the Regular Polygon for you keeping the side length fixed – even with your units set to Ft and Inches, Reshaper will accept 4800mm and display it as 15'8.976" once you click the Apply button, but they are the same length. Whatever the Rotation Angle is when you click Apply will be your new reference angle, so make sure the red line denoting the radius is in the position you want or type a new angle in the Rotation field to set it. Also the anchor point, denoted by the red dot, will remain fixed in your drawing and all other points will expand or contract around it. In your case you have the Top of the circle anchored, so that point will remain fixed and everything else will move when you recalculate. If this isn't what you were looking for, please ask again, or PM me. I am open tomorrow and we can discuss over the phone if you like. Thanks for your comments. Very much appreciated. Raymond
  10. @Letti R beat me to the crux of the answer. There is a caveat for using GetBBox. You need to adjust for the User Origin offset when on a Sheet Layer or inside a Symbol. When you are on Design Layers, you do not need to make the adjustment. So, you need to test for your location before calling GetBBox. Also, if you definitely only want to measure the FIRST SELECTED OBJECT, then leave your return value as "True", as it will stop after processing the first selected object. Raymond
  11. @Thomas W, To answer your last question, YES. There is a 4-Button pre-defined dialog you can use that gives you multiple options – AlertQuestion(). I modified your code (long version) to show how to use it, and am only using 3 of the buttons – for Delete, Skip, and Cancel. For more complicated user interactions you can build a custom dialog, but for what you want, this is quicker. In the following script, I added a { *** NEW *** } label after each line I added. Some lines were deleted, but I did not mark them. PROCEDURE SearchDuplicateWall; { Utiliser ce script dans la vue en Plan 2D. } { ce script va chercher des murs qui ne seraient pas visibles en 2d et qui seraient cachés en étant sur des couches inférieures. } { Use this script in 2D Plan view. } { This script will look for walls which would not be visible in 2d and which would be hidden by being on lower layers. } CONST kWallType = 68; { type objet mur } kCR = chr(13); { Carriage Control char } kSNameTemp = 'Tmp'; VAR Hd1, Hd2 :HANDLE; Done :BOOLEAN; { *** NEW *** } TL_A, BR_A, CenA :POINT; { BBox et points centraux pour A } { BBox & Center Points for A } { TL = TopLeft, BR = BottomRight, Cen = Center } SWallStyleName, ActLName :STRING; PROCEDURE CompareNextObjectWall(Hd2 :HANDLE); { Recherche un mur avec la même boite englobante et le même centre. } { searches for a wall with the same bounding box and the same center. } VAR Choice :INTEGER; { *** NEW *** } Question :STRING; TL_B, BR_B, CenB :POINT; { BBox et points centraux pour B } { BBox & Center Points for B } BEGIN GetBBox(Hd2, TL_B.x, TL_B.y, BR_B.x, BR_B.y); HCenter(Hd2, CenB.x, CenB.y); IF (TL_A = TL_B) & (BR_A = BR_B) & (CenA = CenB) THEN BEGIN SetSelect(Hd2); DoMenuTextByName('Fit To Objects', 0); SetZoom(100); SWallStyleName := GetWallStyle(Hd2); { Do you want to delete this Duplicate whose wall style is: } Question := Concat('Voulez-vous supprimer ce Doublon dont le style de mur est : ', SWallStyleName); Choice := AlertQuestion(Question, '', 1, 'Delete', 'Cancel', 'Skip', ''); { *** NEW *** } CASE Choice of { *** NEW *** } 1: DelObject(Hd2); { Delete } { *** NEW *** } 2: SetDSelect(Hd2); { Skip } { *** NEW *** } 0: Done := TRUE; { QUIT } { *** NEW *** } END; { CASE } { *** NEW *** } END; { if BBox & Cen are equal } END; { CompareNextObjectWall } PROCEDURE CompareHiddenWall(Hd2 :HANDLE); { Recherche un mur qui serait caché dans l'alignement d'un autre mur sans avoir forcément la même taille. } { searches for a wall that would be hidden in line with another wall without necessarily having the same size. } VAR Choice :INTEGER; { *** NEW *** } Question :STRING; CenB :POINT; { points centraux pour B } { Center Points for B } BEGIN HCenter(Hd2, CenB.x, CenB.y); IF (((CenB.x = CenA.x) & (CenB.y <= TL_A.y) & (CenB.y >= BR_A.y)) | ((CenB.y = CenA.y) & (CenB.x >= TL_A.x) & (CenB.x <= BR_A.x))) THEN BEGIN SetSelect(Hd2); DoMenuTextByName('Fit To Objects', 0); SetZoom(100); SWallStyleName := GetWallStyle(Hd2); { Do you want to delete this Hidden Wall whose wall style is: } Question := Concat('Voulez-vous supprimer ce Mur Caché dont le style de mur est : ', SWallStyleName); Choice := AlertQuestion(Question, '', 1, 'Delete', 'Cancel', 'Skip', ''); { *** NEW *** } CASE Choice of { *** NEW *** } 1: DelObject(Hd2); { Delete } { *** NEW *** } 2: SetDSelect(Hd2); { Skip } { *** NEW *** } 0: Done := TRUE; { QUIT } { *** NEW *** } END; { CASE } { *** NEW *** } END; { IF } END; { CompareHiddenWall } BEGIN DSelectAll; Hd1 := LActLayer; ActLName := GetLName(ActLayer); Done := False; { *** NEW *** } WHILE not Done & (Hd1 <> NIL) DO { *** NEW *** } BEGIN IF (GetTypeN(Hd1) = kWallType) THEN BEGIN GetBBox(Hd1, TL_A.x, TL_A.y, BR_A.x, BR_A.y); HCenter(Hd1, CenA.x, CenA.y); DelName(kSNameTemp); SetName(Hd1, kSNameTemp); ForEachObject(CompareNextObjectWall, (NOTINDLVP & NOTINREFDLVP & ((L=ActLName) & (T=WALL) & (N<>kSNameTemp)))); DelName(kSNameTemp); END; { IF } Hd1 := PrevObj(Hd1); END; { WHILE } if not Done then { *** NEW *** } AlrtDialog('Il n''y a pas ou plus de "Doublon" de mur en arrière plan'); { There is no or no more "Duplicate" wall in the background } Hd1 := LActLayer; { Enable next line if you want to be able to cancel each loop separately. } { Done := False; } { *** NEW *** } WHILE not Done & (Hd1 <> NIL) DO { *** NEW *** } BEGIN IF (GetTypeN(Hd1) = kWallType) THEN BEGIN GetBBox(Hd1, TL_A.x, TL_A.y, BR_A.x, BR_A.y); HCenter(Hd1, CenA.x, CenA.y); DelName(kSNameTemp); SetName(Hd1, kSNameTemp); ForEachObject(CompareHiddenWall, (NOTINDLVP & NOTINREFDLVP & ((L=ActLName) & (T=WALL) & (N<>kSNameTemp)))); DelName(kSNameTemp); END; { IF } Hd1 := PrevObj(Hd1); END; { WHILE } if not Done then { *** NEW *** } AlrtDialog('Il n''y a pas ou plus de Murs cachés en arrière plan'); { There are no or no more hidden walls in the background } END; Run(SearchDuplicateWall); If you have any questions, someone is always here. Raymond
  12. Hello @Thomas W, Everything you've written is good. It works and the flow is straight forward. I can only offer very minor suggestions, which you can follow or ignore. They may make your future scripts easier to read later, after you've forgotten how you solved a problem. First, your variable names are nondescript. I changed the variable names to better reflect what they mean. For your BoundingBox vars, you used: A1x,A1y,A2x,A2y, CAx,CAy :REAL; I changed them to: TL_A, BR_A, CenA :POINT; where TL = TopLeft, and BR = BottomRight. Each POINT variable has an X & Y component built in. Where you had 6 variables now there are 3. Consider it a package deal. Type VECTOR gives you a 3-way bundle with XY&Z components. This can reduce clutter for you, and for anyone you are sharing your code with. Second, I replaced your boolean operators, AND and OR, with & and |. These are short circuit operators that do the same thing, but evaluation of the boolean expression stops when the outcome is decided. If A is FALSE, you don't need to evaluate B in the expression (A & B), because B cannot affect the outcome. Likewise for the expression (A | B), if A is TRUE, B does not affect the outcome. If you want to know more about this, just ask. There are other subtleties. I also changed your temp class name, and the CR character (chr(13)), to constants; and I moved your PrefObj() calls outside the IF structures, for style reasons only. Lastly, because I spotted it just before I hit submit, I changed the way you coded your active layer name in your search criteria. Currently, your script only works on the hard coded layer 'Dessin'. In another file your layer names will most likely be different, or you may want to run the script on multiple layers in the same file. By assigning the Active Layer name to a string variable, you can use the <criteria> statement in this script pretty much the way you wrote it, but now (L=ActLName) will replace (L='Dessin'), and you won't have to edit your script to run it elsewhere. It will always run on the active design layer. If you do nothing else, your script looks like this: PROCEDURE SearchDuplicateWall; { Utiliser ce script dans la vue en Plan 2D. } { ce script va chercher des murs qui ne seraient pas visibles en 2d et qui seraient cachés en étant sur des couches inférieures. } { Use this script in 2D Plan view. } { This script will look for walls which would not be visible in 2d and which would be hidden by being on lower layers. } CONST kWallType = 68; { type objet mur } kCR = chr(13); { Carriage Control char } kSNameTemp = 'Tmp'; VAR Hd1, Hd2 :HANDLE; TL_A, BR_A, CenA :POINT; { BBox et points centraux pour A } { BBox & Center Points for A } { TL = TopLeft, BR = BottomRight, Cen = Center } SWallStyleName, ActLName :STRING; PROCEDURE CompareNextObjectWall(Hd2 :HANDLE); { Recherche un mur avec la même boite englobante et le même centre. } { searches for a wall with the same bounding box and the same center. } VAR TL_B, BR_B, CenB :POINT; { BBox et points centraux pour B } { BBox & Center Points for B } BEGIN GetBBox(Hd2, TL_B.x, TL_B.y, BR_B.x, BR_B.y); HCenter(Hd2, CenB.x, CenB.y); IF (TL_A = TL_B) & (BR_A = BR_B) & (CenA = CenB) THEN BEGIN SetSelect(Hd2); DoMenuTextByName('Fit To Objects', 0); SetZoom(100); SWallStyleName := GetWallStyle(Hd2); { Do you want to delete this Duplicate whose wall style is: } IF YNDialog(Concat('Voulez-vous supprimer ce Doublon dont le style de mur est :', kCR, SWallStyleName)) THEN DelObject(Hd2) ELSE SetDSelect(Hd2); END; { if BBx & Cen are equal } END; { CompareNextObjectWall } PROCEDURE CompareHiddenWall(Hd2 :HANDLE); { Recherche un mur qui serait caché dans l'alignement d'un autre mur sans avoir forcément la même taille. } { searches for a wall that would be hidden in line with another wall without necessarily having the same size. } VAR CenB :POINT; { points centraux pour B } { Center Points for B } BEGIN HCenter(Hd2, CenB.x, CenB.y); IF (((CenB.x = CenA.x) & (CenB.y <= TL_A.y) & (CenB.y >= BR_A.y)) | ((CenB.y = CenA.y) & (CenB.x >= TL_A.x) & (CenB.x <= BR_A.x))) THEN BEGIN SetSelect(Hd2); DoMenuTextByName('Fit To Objects', 0); SetZoom(100); SWallStyleName := GetWallStyle(Hd2); { Do you want to delete this Hidden Wall whose wall style is: } IF YNDialog(Concat('Voulez-vous supprimer ce Mur Caché dont le style de mur est :', kCR, SWallStyleName)) THEN DelObject(Hd2) ELSE SetDSelect(Hd2); END; END; { CompareHiddenWall } BEGIN DSelectAll; Hd1 := LActLayer; ActLName := GetLName(ActLayer); WHILE (Hd1 <> NIL) DO BEGIN IF (GetTypeN(Hd1) = kWallType) THEN BEGIN GetBBox(Hd1, TL_A.x, TL_A.y, BR_A.x, BR_A.y); HCenter(Hd1, CenA.x, CenA.y); DelName(kSNameTemp); SetName(Hd1, kSNameTemp); ForEachObject(CompareNextObjectWall, (NOTINDLVP & NOTINREFDLVP & ((L=ActLName) & (T=WALL) & (N<>kSNameTemp)))); DelName(kSNameTemp); END; Hd1 := PrevObj(Hd1); END; AlrtDialog('Il n''y a pas ou plus de "Doublon" de mur en arrière plan'); { There is no or no more "Duplicate" wall in the background } Hd1 := LActLayer; WHILE (Hd1 <> NIL) DO BEGIN IF (GetTypeN(Hd1) = kWallType) THEN BEGIN GetBBox(Hd1, TL_A.x, TL_A.y, BR_A.x, BR_A.y); HCenter(Hd1, CenA.x, CenA.y); DelName(kSNameTemp); SetName(Hd1, kSNameTemp); ForEachObject(CompareHiddenWall, (NOTINDLVP & NOTINREFDLVP & ((L=ActLName) & (T=WALL) & (N<>kSNameTemp)))); DelName(kSNameTemp); END; Hd1 := PrevObj(Hd1); END; AlrtDialog('Il n''y a pas ou plus de Murs cachés en arrière plan'); { There are no or no more hidden walls in the background } END; Run(SearchDuplicateWall); If you consolidate your two subroutines into one, to remove Duplicate and Hidden walls at the same time, your script could look something like this: PROCEDURE SearchDuplicateWall; { Utiliser ce script dans la vue en Plan 2D. } { ce script va chercher des murs qui ne seraient pas visibles en 2D et qui seraient cachés en étant sur des couches inférieures. } { Use this script in 2D Plan view. } { This script will look for walls which would not be visible in 2D and which would be hidden by being on lower layers. } CONST kWallType = 68; { type objet mur } { wall object type } kCR = chr(13); { Carriage Control char } kSNameTemp = 'Tmp'; VAR Hd1, Hd2 :HANDLE; SWallStyleName, ActLName :STRING; TL_A, BR_A, CenA :POINT; { BBox et points centraux pour A } { BBox & Center Points for A } { TL = TopLeft, BR = BottomRight, Cen = Center } PROCEDURE CompareWalls(Hd2 :HANDLE); { recherche un mur qui serait caché dans l'alignement d'un autre mur sans avoir forcément la même taille } { searches for a wall that would be hidden in line with another wall without necessarily having the same size } VAR CondA, CondB, CondC :BOOLEAN; { conditions booléennes } { boolean conditions } TL_B, BR_B, CenB :POINT; { BBox et points centraux pour B } { BBox & Center Points for B } Question :String; BEGIN GetBBox(Hd2, TL_B.x, TL_B.y, BR_B.x, BR_B.y); HCenter(Hd2, CenB.x, CenB.y); CondA := (TL_A = TL_B) & (BR_A = BR_B) & (CenA = CenB); { duplicate walls } CondB := (CenB.x = CenA.x) & (CenB.y <= TL_A.y) & (CenB.y >= BR_A.y); { vertical hidden walls } CondC := (CenB.y = CenA.y) & (CenB.x >= TL_A.x) & (CenB.x <= BR_A.x); { horizontal hidden walls } IF CondA | CondB | CondC THEN BEGIN SetSelect(Hd2); DoMenuTextByName('Fit To Objects', 0); SetZoom(100); SWallStyleName := GetWallStyle(Hd2); { Do you want to delete this Duplicate whose wall style is } IF CondA THEN Question := 'Voulez-vous supprimer ce Doublon dont le style de mur est: ' { Do you want to delete this Hidden Wall whose wall style is } ELSE Question := 'Voulez-vous supprimer ce Mur Caché dont le style de mur est: '; IF YNDialog(Concat(Question, ' — ', SWallStyleName)) THEN DelObject(Hd2) ELSE SetDSelect(Hd2); END; END; { CompareWalls } BEGIN DSelectAll; Hd1 := LActLayer; ActLName := GetLName(ActLayer); WHILE (Hd1 <> NIL) DO BEGIN IF (GetTypeN(Hd1) = kWallType) THEN BEGIN GetBBox(Hd1, TL_A.x, TL_A.y, BR_A.x, BR_A.y); HCenter(Hd1, CenA.x, CenA.y); DelName(kSNameTemp); SetName(Hd1, kSNameTemp); ForEachObject(CompareWalls, (NOTINDLVP & NOTINREFDLVP & (L=ActLName) & (T=WALL) & (N<>kSNameTemp)) ); DelName(kSNameTemp); END; { if } Hd1 := PrevObj(Hd1); END; { while } { There is no or no more "Duplicate" wall in the background } { AND } { There are no or no more hidden walls in the background } AlrtDialog(concat('Il n''y a pas ou plus de "Doublon" de mur en arrière plan', kCR, 'ET', kCR, 'Il n''y a pas ou plus de Murs cachés en arrière plan')); END; Run(SearchDuplicateWall); Honestly, none of these changes are necessary. Everything you've written is fine, and the modified scripts work identically to yours. The only thing I would recommend you do differently is add more comments as you script. It will help you down the road when you revisit your scripts. Consider if this script was 1000 lines, or lots more, instead of ~100 lines. Comments will save you a lot of confusion and headaches later on. HTH, Raymond
  13. No, not all menu items can be called by DoMenuTextByName(). Sorry. And the documentations is also incomplete. What functions are you trying to use? If after trying what you think should work, and any variation of that command that seems reasonable and your attempts don't succeed, check back to this Forum. You will probably get a very quick confirming answer from someone who has tried before. If you are really lucky, you will get the name of a command that will work. All the best, Raymond
  14. @michaelk, If you are using "Case ________ of" then you must be using VectorScript, in which case you'd use (borrowing from @Julian Carr's example above): ... vsoGetEventInfo(theEvent, theData); case theEvent of { other events here } 60: BEGIN { Edit Plug-in Style } vsoSetEventResult( -10 ); {kObjectEventHandled} { using -10 here causes the object properties dialogue to open next } END; 61: BEGIN { Create Plugin Style } vsoSetEventResult( 0 ); {kObjectEventHandled} END; 62: BEGIN { Update Styled Plugin Object } vsoSetEventResult( 0 ); END; 63: BEGIN { Finalize Create Style } vsoGetPluginStyleSym(gh1); SetAllStyleParams(gh1, 0); { this sets all parameters to not use the style } vsoSetEventResult( 0 ); END; 64: BEGIN { Finalize Update Styled Object } vsoSetEventResult( -8 ); END; 65: BEGIN { Style Widget Chosen } vsoSetEventResult( 0 ); END; { Create Style order of events: 61, 63, 60, 62, 64 } { Edit Style order of events: 60, 62, 64 } { more "other events" here } end; { case theEvent } If you are using Python, there is no "CASE" statement, so you'll have to use an "IF" tree. HTH, Raymond
  15. Have you tried: def vs.GetCustomObjectProfileGroup( objectHand )    return HANDLE where objectHand can be a handle to a PIO object in the drawing when your script executes outside of PIOs, and objectHand can be gPio_H (from your example above) when your script is the PIO script? Raymond
  16. Asking for two input parameters may be a mistake, but it may also work as defined if the second parameter is sometimes an input parameter. Some input parameters will accept NIL (or None) as valid input and report differently from passing in a non-NIL value. Again, I'm guessing here as I've never used the function. If it works as you've shown, then use it. Keep notes for future reference. You never know if, or when, things may change. Raymond
  17. Hello @Gregi, Though I haven't used either command it appears the first, vs.vsoGetPluginStyleSym(), is used to reference itself and return the Symbol Definition linked to its STYLE definition. Its description says: "Allow an object to use its own implementation in creating and maintaining a plugin style." It must be used inside the PIO code, as indicated by the first three letters in the command name "vso". The second command, vs.GetPluginStyleSymbol(), appears to be used outside a PIO, as in a script that queries PIO objects, and it will return TRUE if the object is STYLED, and FALSE if it isn't. If it returns TRUE, it will also return a handle to the symbol that's used to define its STYLE. The best way to see what they do is to try them in simple scripts. Place a STYLED PIO in a drawing and write a short script with: Boo, SymHnd = vs.GetPluginStyleSymbol(FSActLayer) to see what it returns. Message out the boolean result, and the object type and symbol name of the returned handle. The vso command will require more setup to test its functionality, but if you are developing a STYLED PIO, place vs.GetPluginStyleSym() in your PIO script and set an AlrtDialog() with the object type and symbol name of the returned handle to see what comes out. You may have to move the command around so that it executes in the proper event and at the proper time. If this is not clear, wait for better answers. I'm sure they are out there. Raymond
  18. @bsalee, If you only want assign a static class name, the script is easy. But if you want to be able to redefine a new Class Name often, the script will need to be more complicated. You can edit this script, or have multiple copies of it in your file, each with a different class name to set commonly used class names. If the class name in this script does not exist in your file, it will be created so you won't have to create it ahead of time. For starters, place the following script in one of your files by adding it to a Script Palette (new or existing). Duplicate it if you want a choice of class names. If you like how it works, you can add this script(s) to your template files so it(they) will always be there when you start new work; or make a Menu Command plug-in, where you can assign a HotKey to it; or make a Tool plug-in, which can also have an assigned HotKey. More on the second and third options when you get that far. Here's the simple script: PROCEDURE ChangeDimClassName; { Click on Dimension objects to change their class to the class name defined in "kNewClass". } { Change constant "kNewClass" to suit your needs. } { If the object you select is not a Dimension object, nothing happens and program continues. } { To STOP, click in empty drawing space, or press any key on keyboard. } { 9 Apr 2023 - Raymond Mullin } CONST kNewClass = 'New Dim Class'; kDimType = 63; VAR H :Handle; X, Y :Real; BEGIN H := FObject; { dummy handle } while (H <> nil) do begin GetPt(X, Y); H := PickObject(X, Y); if (GetTypeN(H) = kDimType) then SetClass(H, kNewClass); end; { while } END; Run(ChangeDimClassName); HTH, Raymond
  19. @bsalee, Could you please explain in a little more detail what you want to happen? Are you referring to this setting in the Document Preferences, as the dimension class name you want to assign? Or, are you wanting to assign another class to dimensions that you click on? Or, do you want to toggle that Document Preference ON and OFF? It is possible to set it up as either a TOOL, or a SCRIPT, but there are some nuances in the way each functions. More detail will help. If you could clarify your request a bit, I or someone else might be able to help. Thank you, Raymond
  20. @Jayme McColgan, LOL – Love the enthusiasm of your reply! A note at this point would only benefit other people. I'm pretty sure you will never need that example again 😉, but I'll add a note soon. If you are using the HTML version of the script reference, a user's note will not show up. I can only add one to the online Developer WIKI. FYI Glad I could help, Raymond
  21. Hi @Jayme McColgan, The easiest way is to delete the first (0th) element N times. Your code is moving up the list as your list is shrinking, so yes, there will be residual entries left over. Try: for i in range(vs.GetChoiceCount(dialog1, 36)): vs.RemoveChoice(dialog1, 36, 0) Raymond
  22. @RobinS, I seriously doubt this answer is timely enough to help you, but maybe it will help another. Last year (2022) I bought a new Mac to be able to upgrade the OS past OS 10.15, which enables me to run VW 2023. Currently, I'm using a macMINI (M1, 2020) with OS 12.6.4. VW 2015 seems to run well. I do have problems with VW 2019 needing manual screen redraws to update the display, and VW 2016 does not load anymore. These are the only two versions that are giving me problems. VW 2015, '17, '18, & '20 all work without noticeable problems. This does not mean they will work without any issues, just that my workflow does not suffer from them being unsupported. Additionally, VW 2015 worked for me when I had OS 10.11 - OS 10.15 (macMINI 2012), and OS 11 (macMINI M1 2020) loaded. I was very surprised and elated with these results. Still am. HTH, Raymond
  23. Pref 44 is shorthand for VW Application Preference 44. It is a boolean flag, meaning it has a value of True or False. Use Boo := GetPref(44); to read the value into boolean variable "Boo", SetPref(44, True); to set the flag, and SetPref(44, False); to clear the flag. The results of these commands can be seen in the Document Preferences dialog. The checkbox will change states with this Pref 44 value, or vice versa. Pref 546 is in the newer versions of VW and you would use L := GetPrefLongint(546); to read it into variable "L", which you define as a LONGINT. Poof – You are now in the Cult. Drink the KoolAid and Smile 😁 Next Week we'll explore Toggle Scripts. Raymond
×
×
  • Create New...