Jump to content

DCarpenter

Member
  • Posts

    111
  • Joined

  • Last visited

Posts posted by DCarpenter

  1. @MullinRJ - that's amazing.  I think vectors are very powerful but I have a hard time getting my brain wrapped around them.  I think because they looks so similar (Pt.x, Pt.y, and Vec.x,Vec.y) I have a hard time understanding how I use them differently.  Is there a good place to help me understand vectors better?

     

    Dave

  2. Embarrassing question #382

     

    In my script, I've drawn a line, and rotated it.  Now I want to change the length of the line, while keeping it's first point (Pt1) stationary.  I feel like there should be a simple command like SetLLength(); but I can't find anything like that, or do I just need to recalculate Pt2 using a bunch of trig?  Hoping there's an easy way I don't know about.

     

    Dave 

  3. I lost a couple hours on this issue as well.  This thread saved me from pulling the rest of my hair out.  Sure would be nice is VW could add that little note to the dialog box that pops up that the image also needs to be 72 dpi.

    Screenshot 2024-04-11 at 1.08.58 PM.png

  4. WINNER, WINNER, CHICKEN DINNER!!!

     

    Your right, I needed to define the object being extruded.  It works now.  Still not sure why the option using the BeginPoly/EndPoly with the HExtrude() afterwards didn't work, but I'm so happy to have found a solution, I don't really care.  Big thank you for helping me think through this.

     

    Dave

     

    BeginXtrd(0',12');
        BeginPoly;
            FOR i:=1 TO k DO BEGIN
                AddPoint(FullArrayPts[i].x,FullArrayPts[i].y);
            END;
        EndPoly;
        h1:=OffsetPoly(LNewObj,6", 1, TRUE,  TRUE, 1, 0.1);
    EndXtrd;

  5. I tried the BeginXtrd/EndXtrud idea, with GetCustomObjectPath() and OffsetPoly(), but nothing.  The extruded poly was completely missing from the 2D and 3D views.  There was no trace of it anywhere.  I couldn't even get the BeginXtrd/EndXtrud to work by it's self which is weird, which makes me wonder if the script is corrupted or something.

    Dave

     

    BeginXtrd(144",240");
        FOR i:=1 TO k DO BEGIN
            {LineTo(FullArrayPts[i].x,FullArrayPts[i].y);}
            AddPoint(FullArrayPts[i].x,FullArrayPts[i].y);
        END;
    EndXtrd;

    {h1:=GetCustomObjectPath(LNewObj);
    h2:=OffsetPoly(h1,6", 1, TRUE,  TRUE, 1, 0.1);}

    Screenshot 2024-04-10 at 2.42.34 PM.png

  6. Sorry for all the replies.  The reason why I abandoned the BeginXtrd/EndXtrud idea is because I need to do an OffsetPoly() command before the poly is extruded, and I don't think that's allowed within a BeginXtrd/EndXtrud command, and am unsure how I would do that after the BeginXtrd/EndXtrud command.  Is it just a matter of using the GetCustomObjectPath() and then after getting a handle to the path, execute the OffsetPoly() command?

     

    Dave

  7. 12 minutes ago, JBenghiat said:

    If this is part of a PIO, use BeginXtrd/EndXtrd instead of HExtrude.

    Originally, I used BeginXtrd/EndExtrd, and calculated the vertices but abandoned that idea early on.  Thinking about it now, I might be able to revisit that idea and use it with the FOR/TO command.

    I'll let you know how it goes.

     

    Dave

  8. I even created a smaller test script and it work correctly. 

    But for some reason it doesn't work in my bigger script.

    Dave

     

    PROCEDURE Test;
    VAR
        h1 : HANDLE;
        i : INTEGER;
        FullArrayPts: DYNARRAY[] OF POINT;
        
    BEGIN

        ALLOCATE FullArrayPts [1..5];

        FullArrayPts[1].x:=0; FullArrayPts[1].y:=0;
        FullArrayPts[2].x:=5; FullArrayPts[2].y:=1;
        FullArrayPts[3].x:=9; FullArrayPts[3].y:=4;
        FullArrayPts[4].x:=12; FullArrayPts[4].y:=8;
        FullArrayPts[5].x:=13; FullArrayPts[5].y:=13;

    BeginPoly;
        FOR i:=1 TO 5 DO BEGIN
            AddPoint(FullArrayPts[i].x,FullArrayPts[i].y);
        END;
    EndPoly;

    {SetPolyClosed(LNewObj,TRUE);}
    h1:=HExtrude(LNewObj,4",144");

    END;
    Run(Test);

  9. Thank you for your comments,  I'm switched the LineTo() command to AddPoint() command, and added a SetPolyClosed() command, but it still doesn't want to extrude.  Thoughts?

     

    BeginPoly;
        FOR i:=1 TO k DO BEGIN
            {LineTo(FullArrayPts[i].x,FullArrayPts[i].y);}
            AddPoint(FullArrayPts[i].x,FullArrayPts[i].y);
        END;
    EndPoly;
    HMove(LNewObj,24",0);
    SetPolyClosed(LNewObj,TRUE);
    h1:=HExtrude(LNewObj,4",144");

    Screenshot 2024-04-10 at 1.57.22 PM.png

  10. Since I haven't received a response, I've rewritten my script to collect the points (vertices) so I can create one single polygon to extrude.  The polygon is created, and I can move it, but I can't extrude it.  Any ideas why?  Is it possible my script is some how corrupted?

     

    Dave

    Screenshot 2024-04-10 at 10.37.58 AM.png

  11. I posted this a few days ago on a different thread but didn't get any response, so instead of highjacking that thread I thought it best to start a new one.  The issue is very simple, I created two 2D polygons and wanted to combine them (using the menu command, Compose) and then extrude it.

     

    PROCEDURE Test;
    VAR
        poly1, poly2, polyOut : HANDLE;
        TF : BOOLEAN;
    BEGIN
        Poly( 0,0, 10,0, 10,10, 20,10 );
        poly1 := LNewObj;

        Poly( 0,0, -10,0, -10,10, -20,10 );
        poly2 := LNewObj; 
        
        SetSelect(poly1);
        SetSelect(poly2);
        
        DoMenuTextByName('Compose',0);

    END;
    Run(Test);

     

     

    My apologies for dragging out this thread, but I can't figure out why I can't execute the example above in my larger script that I'm writing.  I've tested and checked that I do have the two polygons selected (the blue objects in the screen shot below) that I want to combine, and that they are the only two things selected before executing the DoMenuTextByName('Compose',0) command.  But for some reason, the two poly's don't combined.  If I convert the PIO into a group and grab the two poly's myself, I can execute the Compose command and they combine correctly which proves to me that the two poly's are touching each other and can be combined.  Hoping there might be someone smarter than I that can help me figure this out.  Happy to provide the code or VWX file if that's helpful.

    Dave

     

     

        BeginPoly;

              ......

        EndPoly;
        h1:=LNewObj;

     

        BeginPoly;

              ......

        EndPoly;
        h2:=LNewObj;
        DSelectAll;
        SetSelect(h1);
        SetSelect(h2);
        DoMenuTextByName('Compose',0);

     

     

    Screenshot 2024-04-05 at 4.54.56 PM.png

  12. PROCEDURE Test;
    VAR
        poly1, poly2, polyOut : HANDLE;
        TF : BOOLEAN;
    BEGIN
        Poly( 0,0, 10,0, 10,10, 20,10 );
        poly1 := LNewObj;

        Poly( 0,0, -10,0, -10,10, -20,10 );
        poly2 := LNewObj; 
        
        SetSelect(poly1);
        SetSelect(poly2);
        
        DoMenuTextByName('Compose',0);

    END;
    Run(Test);

     

     

    My apologies for dragging out this thread, but I can't figure out why I can't execute the example above in my larger script that I'm writing.  I've tested and checked that I do have the two polygons (the blue objects in the screen shot below) selected that I want to combine, and that they are the only two things selected before executing the DoMenuTextByName('Compose',0) command.  But for some reason, the two poly's don't combined.  If I convert the PIO into a group and grab the two poly's myself, I can execute the Compose command and they combine correctly which proves to me that the two poly's are touching each other and can be combined.  Hoping there might be someone smarter than I that can help me figure this out.  Happy to provide the code or VWX file if that's helpful.

    Dave

     

     

        BeginPoly;

              ......

        EndPoly;
        h1:=LNewObj;

     

        BeginPoly;

              ......

        EndPoly;
        h2:=LNewObj;
        DSelectAll;
        SetSelect(h1);
        SetSelect(h2);
        DoMenuTextByName('Compose',0);

    Screenshot 2024-04-05 at 4.54.56 PM.png

  13. Jesse, thank you.

     

    I wasn't familiar with the those two similar commands DoMenuTextByName and CallToolByName.  The AddSurface option gave me some intersecting geometry which didn't allow me to extrude the polyline after it was created, but the DoMenuTextByName option gave me exactly what i needed.  REALLY REALLY appreciate your help.

     

    Dave

  14. Using the example above, how do I use the CallToolByName('Compose') to join two polygons created within the script?  Should be simple but what am I missing?

     

    PROCEDURE Test;
    VAR
        poly1, poly2, polyOut : HANDLE;
        TF : BOOLEAN;
    BEGIN
        Poly( 0,0, 10,0, 10,10, 20,10 );
        poly1 := LNewObj;

        Poly( 0,0, -10,0, -10,10, -20,10 );
        poly2 := LNewObj;
        
        SetSelect(poly1);
        SetSelect(poly2);
        
        TF:=CallToolByName('Compose');

    END;
    Run(Test);

  15. I apologize in advance for this simple question but I'm mentally stuck.

     

    I've created an object within a script using BeginXtrd/EndXtrud,  Now I want to duplicate it and change the extruded height of the copy.  How do I grab that variable and change it?  My brain is simple not telling me what the command is to do that.

     

    BeginXtrd(5",10");

    ....

    EndEtrd;

    Duplicate(0,0);

    { Command to change the extrude of the LNewObj }

     

    Dave

  16. You nailed it!!!

     

    All my scripts and include files are in a folder within the Plug-ins folder ( Plug-ins/Myscripts/... ), but when I created a new linear object, it (by default) places the new script in the Plug-ins folder which is why it couldn't find the include file.  So I placed the new linear object script inside my 'Myscripts' folder and my script compiled correctly.  I think, in my head, I thought it would look within everything within the Plug-ins folder for the include file, but apparently not.  

     

    Big thank you once again.

    Dave

  17. I use the $INCLUDE command on many of my scripts, and it works just fine.  I'm involved with changing this current script from a point object to a linear object and in doing so I'm simple copying and pasting the code from object to another, but in doing that I've generated a script error on my $INCLUDE line and I'm not sure why.  I've tried rewriting it, closing it/reopening it, closing/opening VW, but nothing seems to be working.  It works fine in the original script, but not this one.  Thoughts?

     

    Dave

    Screenshot 2024-03-20 at 2.14.51 PM.png

  18. Pat,

     

    Thank you so much.  It's interesting that the Data Tag doesn't automatically update the name of the viewport when it changes unlike other information that a Data Tag updates right away. If you would allow me to highjack this thread and take it in another direction, a questions I've always wondered is what is the program language is that Data Tags use?  I've written a fair amount of scripts and I feel like Data Tags could be very powerful, but have had trouble finding where I can find more information about the language it uses and how to access different functions or procedures.  Any insights on that would be greatly appreciated.

     

    Dave

  19. See attached.  In customizing a Drawing Label, I'm hoping I can capture the name of the viewport that the Drawing Label is in.  It's able to capture the scale of the current viewport so I would think it would be easy to capture the viewport name.  But for everything I've tried to enter: #Drawing Label2#.#Name#, #Object Name#, #ObjectN#, #Viewport Name#, etc., nothing seams to work.  Does anyone have any ideas?

    Screenshot 2024-03-01 at 2.01.38 PM.png

×
×
  • Create New...