Jump to content

Sam Jones

Member
  • Posts

    1,185
  • Joined

  • Last visited

Posts posted by Sam Jones

  1. This is a big problem for using dimensions in VS.  I can get the dimension value text to the center between ends by using the calculated position, but I need to align the dimension text with the dimension line.  Dimensions below an object shove the dimension text into the object and it is important that the dimensions on all sides look the same in text style and spacing.  This is not possible if the text cannot be aligned to the dimension line.  This has the potential of scuttling the automation of this graphic.

  2. Thank you @Pat Stanford and @C. Andrew Dunning for the line style help.  Works like a charm.

     

     

    I would like to set the text size of a dimension that I create inside a PIO.

    I draw the dimension with:

                            LinearDim(x1, y1-(bayDepth/2), x1-offsetLft, y1-(bayDepth/2), 0, 0, 771, 770, 0 );

    I would like to set the size of the text in that dimension object to 2.  I attempted to do this with the following line:
                            SetObjectVariableReal(LNewObj, 17, 2);

    Nothing changed.  I can replace the "2" with any value and still nothing changes.  Hopefully there is a way to control the text size of a dimension created in a PIO.

    Thoughts ?

     

    Sam

  3. Is there a way to get the line style index number from a name of the line style in VS?

    I both want to set the line style for an object and I want to set the line style for a class, but both call require and index and I only have a name.

     

    Is there a way to define a line style in VS, setting its name and index, or setting the name and getting the index?

     

    As always, TIA.

     

  4. Assuming that "BooResult := GetCustomObjectInfo(PIOName, PIOHan, PIORecHan, PIOWallHan);" has been run before the "CASE TheEvent OF", the PIOHan is NIL during the kObjOnInitXProperties event and the PIORecHan won't recognize the 800 constant.  So the question becomes where to put the "SetObjectVariableBoolean(PIOHan, 800, TRUE);".

     

     

  5. I have a point PIO that has a CreateText() command in it.   When it is placed, the document font and text style chosen in the Text menu are used.  All well and good.  I would like to be able to select existing instances of the PIO and choose a new font and text style from the Text menu and have those selected instances use the newly selected font and text style for the CreateText() procedure in the Reset Event.  I have seen other PIOs do this, but currently instances of my PIO will not.  There are no text formatting procedures in the PIO code except for some alignment procedures.  How can I get my PIO to respond to the text formatting selected.  😁 😁

  6. I don't think there is a way to do what you want.  Label Legends (LLs) are linked to the Lighting Device instance they report on, and you can only assign one LL to a Lighting Device.  You can turn on and off class visibility of LL fields on a viewport by viewport basis.  Thiscan make one LL do the job of two by allowing one field to be placed on top of another (or elsewhere), but you won't be able to put the same field in 2 different places in the same LL.  You can copy field values to other fields (usually user fields) and you can create your own custom fields.  These options will usually achieve the functionality of multiple LLs.

  7. We're all interested.  Like @C. Andrew Dunning I don't have the band width because of my own projects, and that may be the rule here, which is too bad.  We would all love to see what others have figured out, and even share some cool tricks.  You may get comments on the code you post, and maybe we can have a good discussion around that code that includes are own code snippets.  I hope I'm wrong, but a serious go at the picture above would be daunting, interesting, but daunting.  Hopefully, @michaelk, who is an excellent VS drawer, or @PatStanford who loves the puzzle will jump in, but again, bandwidth will handicap a serious VS attempt to make a PIO out of that drawing.  Here's hoping.

    • Like 1
  8.  

    1 hour ago, Cristiano Alves said:

    Any video or tutorial to watch this feature?

    Nope.  The functionality is part of a general plug-in to place accessories.  The plug-in is one of over 100 plug-ins/scripts that make up AutoPlot Tools for Spotlight,  www.autoplotvw.com.  The tools have a 2 month fully functional trial period.  If you want to Zoom, I can walk you through using any of the plug-ins. 

  9. The parent of what, and do I want the parent to be nil when I select the PIO in the palette in order to suppress the StrDialog?

     

    Prior to the event Case test I have the following lines

        BooResult := GetCustomObjectInfo(PIOName, PIOHan, PIORecHan, PIOWallHan);
        vsoGetEventInfo(TheEvent, EventMessage);

     

    At the beginning of the ResetEvent procedure I set the IsNew variable with

    IsNew := IsNewCustomObject('RG Grid Marker');

     

    In the ResetEvent procedure I draw the graphic and then have the following test:

    IF (IsNew & (GetParent(PIOHan) = NIL)) THEN

               {Post the StrDialog()}

  10. I have a point PIO, that puts up a StrDialog() to ask a question when the PIO is inserted.  This is triggered in the Reset Event and only triggered if the PIO instance is new.  Unfortunately, The StrDialog is triggered when  the PIO is selected in the tool Palette and then triggered again when when the first instance is placed.  After that, the StrDialog correctly only appears when a PIO is placed.  If I select another tool, the problem reappears when the PIO is again selected in the tool palette.

     

    Is there a way to differentiate the time when a point PIO is selected in the tool palette, from when it is placed in the drawing?

     

    As always, TIA

  11. 9 hours ago, JBenghiat said:

    I’m going to take the opportunity to plug BeamViz, which automatically creates the mask for elliptical beams. 

     

    He doesn't mention it enough.  BeamViz is an absolutely amazing plug-in.  It vastly expands the ability to visualize and manipulate light beams and integrates with Spotlight Lighting Devices seamlessly.  Get this plug-in; it will blow you away.  The downside/upside to this tool is that there is so much functionality you need to take some time to explore it all.

    • Like 3
  12. Prior to 2024, to encrypt a plug-in, I would open the Plug-In manager, select the plug-in, be sure the caps-lock key was activated, and double click on the plug-in name in the Plug-In manager.  When I do that in VW 2024, I get this alert.

    image.png.b9c5c10f38160d1a3aabc62fc072c242.png

     

    What do I do to encrypt a plug-in?

     

  13. In a simple command, the code below will return the plan rotation of a VW drawing.

     

    PROCEDURE GetPlanRotation;

    VAR
        PlanIsRot    :BOOLEAN;
        PlanRot        :REAL;

    BEGIN
            PlanIsRot := GetPref(92);
            PlanRot := GetPrefReal(93);

            AlrtDialog(CONCAT('PlanIsRot = ', GetPref(92), ',  PlanRot = ', GetPrefReal(93)));
    END;
    RUN(GetPlanRotation);

     

    Below are the first 8 lines of the code for an event aware PIO

        CurrClass := ActiveClass;
        GetVersion(Major,Minor,Maintenance,Platform);
        GetUnits(Fraction,Display,Format,UPI,UnitName,SquareName);
        result := SetObjPropCharVS(kObjXPropShowPrefDialogWhen, '0');
        PlanIsRot := GetPref(92);
        PlanRot := GetPrefReal(93);
        AlrtDialog(CONCAT('PlanIsRot = ', PlanIsRot,
                        ',  PlanRot = ', PlanRot));

     

    The alert below is always returned no matter what the plan rotation is.

    PlanIsRot = FALSE

    PlanRot = 0

    Is there a way to retrieve the plan rotation from within the code of an event aware PIO?

     

  14. Actually, I have no clue.  None of the worksheets to which I do this have sheet images.  I would imagine that the worksheet image would disappear for the deleted worksheet.  However, if you placed the worksheet with a script you can just place it again.  If you didn't originally place it, I would imagine you could collect the location of the worksheet before you delete it and place or move the new one to that location.

     

        WKS := GetObject(WKSName);
        WKSImage := GetWSImage(WKS);
        GetBBox(WKSImage, X1, Y1, X2, Y2);

        DelObject(WKS)

  15. 7 minutes ago, Jesse Cogswell said:

    One way that I've done this is to use DelObject to delete the existing worksheet before creating the new one.

    That's what I do.

    IF GetObject(GetName(worksheetName)) <> NIL THEN

            DelObject(GetObject(GetName(worksheetName)));

    WKSHandle := CreatWS(worksheetName, RowNum, ColNum);

     

  16. One assumes that you want to sort by a prime column, and then you want to sort by the second column within all the identical prime values.

     

    AA    1

    AA    2

    AA    3

    AB    1

    AB    2

    AB    3

    AB    4

    AB    5

    BB    1

    BB    2

    BB    3

    BB    4

     

    Or for what you describe:

     

    X, Y

    8, 5

    9, 5

    10, 5

    4, 11

    5, 11

    6, 11

    7, 11

    1, 23

    2, 23

    3, 23

     

     

    You would have to use your own sort algorithm and put it into a procedure or code block.  Making a reusable procedure is tricky but a code block is simple.  The simplest that I know of would be a bubble sort. 

     

    A bubble sort on 2 values is most easily coded using a STRUCTURE type in VS, but isn't required.  Bubble sorts are not efficient, but they work well hundreds of elements even the low thousands, more than that and you would want something more efficient.

     

    Let me know if you need a code sample of a bubble sort.

     

     

     

×
×
  • Create New...