Jump to content

WhoCanDo

Member
  • Posts

    435
  • Joined

  • Last visited

Posts posted by WhoCanDo

  1. I'm seeing a lot of good ideas coming through here.

     

    I started with the sweep but failed. That doesn't mean that I got the setup right though LOL.

     

    Just to confirm. The split-pin that is protruding, is press fitted into the bolt. A compression spring is extending from the top of the bolt (not shown).

     

    When the bolt is turned 180°+, the split-pin is to slide along the horizontally cut solid subtraction so that the spring is tightened by half a turn.

     

    That is why it is so important that the sides of the slot are all horizontal as it goes.

     

    Even though I have a solution, I'm going to have a go at some of the ideas above so I can experience the tools and methods.

     

    image.png.079a7415228c4cf88be132c19640a152.png

    • Like 2
  2. Nice one VE

     

    I can use this for my next development.

     

    However, for this one, when you fillet the top, the center of the circle is not the center of the pipe. If I rotate the development to align the center of the circle to the center of the pipe centerline, the side of the circle is not perpendicular to the pipe center plane.

     

    image.png.748243f8f8c47ea2288d96b9ccbe0aa6.png

     

    If I rotate the development, the left side is not perpendicular to the centerline plane.

     

    Therefore, I ended up working from basics.

     

    I drew a circle on the centerline in the front view and extruded it. If I subtract solids at this point, I will have a hole in the wall.

     

    But before subtracting surfaces, I duplicated it, rotated it, and moved it downward - 200 times in a 180° sweep.

     

    Painful if I did this manually, so I made a macro. Not fancy, but cheap.

     

    procedure Fetch;
    
    var
    i : integer;
    pX, pY, D, R : real;
    h : handle;
    
    begin
    pX := -1228.91; pY := 103.72; { Top view pipe centerline }
    R := 0.9; { Rotation angle }
    D := -0.0575; { Drop distance }
    
    for i := 1 to 200 do
    	begin
    	h := LSActLayer;
    	Duplicate (0, 0);
    	RotatePoint (pX, pY, R);
    	h := LSActLayer;
    	Move3DObj (h, 0, 0, D);
    	end;
    end;
    run (Fetch);

     

    I then added the solids.

     

    Duplicating this solid, rotating it 180° and then subtracting the two solids from the tube gave the result I needed.

     

    image.thumb.png.c6a06a121613f515479547b7da50ecbc.png

     

    Thanks for showing me some new methods of creating objects using tools that I wouldn't have thought of.

     

    It was a very challenging model.

    • Like 2
  3. Hi,

     

    I need to mill out a curved slot like this. It's a vertical pipe with a hole drill horizontally and the milled horizontally down and around to the far side.


    I can make the nurbs curve, but I can't extrude it so that it can be subtracted from the pipe solid.

     

    image.png.9834c0e4f2283cec1e095c1a3b8e5c0d.png

  4. Ok.

     

    Sorry to challenge you all when there was not challenge.

     

    The problem was the export settings.

     

    I'm still not sure why there is a difference between the VS pipe and the manually built pipe, but AutoCad only opens the drawing properly when the "Use DXF/DWG indexed colours" is picked (with or without the "Map line weights to colours").

     

    image.png.916b12c92f50550519c892cb8b2554e3.png

    • Like 1
  5. This code work perfectly in VW, but after exporting the pipe to AutoCad, AutoCad shows this pipe on the left.

    image.thumb.png.f305831bfdc0e4fea5684de91db1a23d.png

    The other two pipes, to the right, created manually with VW tools/menu options, work fine.

     

    Can anyone suggest what needs to be adjusted in the code to make the left look like the right please?

     

    The macro uses a line that is drawn to length and is selected at the time of running the code.

     

    GetPolylineVertex (h2, 2, p1X, p1Y, N, PipeR);
        h1 := ConvertToNurbs (h2, false);
        PipeLnth := HLength (h1);
        Oval (-PipeOD/2, PipeOD/2, PipeOD/2, -PipeOD/2);
        h2 := LNewObj;
        Oval (-PipeOD/2 + WallWdth, PipeOD/2 - WallWdth, PipeOD/2 - WallWdth, -PipeOD/2 + WallWdth);
        h3 := LNewObj;
        ClipSurface (h2, h3);
        h4 := PrevObj (h3);
        h5 := CreateCustomObject ('Extrude Along Path', 0, 0, 0);
        DelObject (h2);
        DelObject (h3);

     

    I have also tried "h5 := CreateCustomObjectPath ('Extrude Along Path', h1, h4);" which didn't change anything.

     

    In AutoCad, the left pipe is a "Block Reference", the right top is a "3D Solid", and the right bottom is a "Block Reference".

  6. I'm seeing that your suggestion works when I switch workspaces.

     

    I haven't reset the V button so I'm not sure how it attached itself to the Visibility tool.

     

    I will have to make a new workspace using a copy of the default.

     

    Thanks. The V does do what I was expecting by hovering over the Unhide button. Interesting.

  7. To use the V key as you suggest, when you have hidden some objects, don't you then have to change your preferences to toggle the "Visible mode" ?

     

    Then when you hit the V key, that's when the ghosts appear.

     

    If you forget to change your preferences, then you have to select them after hitting the V key.

     

    I would still opt for a default hover over the unhide button to temporarily ghosting the hidden objects.

     

     

  8. It's been a while since asking this question.

     

    I'm guessing that VW can't do this, or no one else has a need to do this.

     

    However, if anyone else is hunting for an answer, I have a work around.

     

    Since you already know the file name you want to create, use ReWrite (DataFName); and Close (DataFName); to create a blank file or set of files ( I needed 5 exported worksheet PDF files ).

     

    Function ChangeLocalFileName (Prefix : string) : string;
    var FName : string;
    begin
    FName := Concat (Copy (GetFPathName, 1, Pos (GetFName, GetFPathName) - 1), Prefix, GetFName);
    FName := Concat (Copy (FName, 1, Pos ('.vwx', FName) - 1), '.pdf');
    ChangeLocalFileName := FName;
    end;
    
    begin
    ReWrite (ChangeLocalFileName ('WORKSHEET1 '));
    Close (ChangeLocalFileName ('WORKSHEET1 '));
    end;

     

    Then, when Window's saving convention pops up, just click the appropriate file name created previously to overwrite it.

     

    It sure saves time and RSI.

  9. Another day. I tried the import and ungrouping. It worked today so not sure what happened after the update.

     

    However, I still can drag and drop any files after the SP6 update.

     

    This is a problem because I often drop multiple PDF, DWG & IFC files to open/import them.

     

    I'm not keen to update my other PC if it's going to be the same. However that is Windows 10 and this one is Windows 11 - which did work in SP5

  10. I just updated to SP6

     

    I've lost my drag and drop.

     

    I can't drag vwx, dxf, pdf, dwg, etc. and drop them into my VW2024 SP6

     

    Can you ?

     

    Additionally, when I Import a .pdf and ungroup it, after deleting the bmp and blackout page, there is no vector drawing left.

     

    Note: I am on a Windows 11 PC at the moment.

  11. After all this time, I still can't get a reliable search happening.

     

    This code supposes this hierarchy ..

     

    IfcMechanicalFastener

        Tekla Bolt

            Bolt Name

     

    and it works well.

     

    However, I have a client that sent me an IFC file with this hierarchy ..

     

    IfcMechanicalFastener

        IfcMechanicalFastener

            Bolt Name

     

    and it doesn't work when I try and find the Bolt Name.

     

    Can someone suggest a reason please ?

     

     

    Procedure SelectByIFCProperty;
    
    {December 13, 2019}
    {© 2019 Patrick Stanford pat@coviana.com}
    {Licensed under the GNU Lesser General Public License}
    
    {Selects all objects that are defined as IFCMechanicalFastener }
    {and have an IFCPSet of Tekla Bolt with a non-blank Bolt Name attached.}
    
    {Here be dragons. No Warranty Expressed or Implied. Use at your own risk}
    
    Var
    	B1:Boolean;
    	S1,S2,S3,S4:String;
    	N1:Integer;
    	
    Procedure Execute(H1:Handle);
    		Begin
    			B1:=IFC_GetPSetProp(H1,S3,S4,S2,N1);
    			If ((B1=True) & (S2<>'')) then SetSelect(H1);
    		End;
    Begin
    	
    	S1:='Tekla Bolt.Bolt Name';
    	S3:=Substring(S1,'.',1);
    	S4:=Substring(S1,'.',2);
    	
    	DSelectAll;
    	ForEachObject(Execute,((IFC_ENTITY='IfcMechanicalFastener')));
    End;
    
    Run(SelectByIFCProperty);

     

     

  12. I'm formatting a worksheet for a job.

     

    In the "Total Items" cell, I want the answer  =sum(B12, B13, etc.)

     

    However, this doesn't work.

     

    Then I tried summing the answer under the list in cell B17 and tried the formula  =B17  in cell G3. That didn't work either, even though the B17 cell showed the answer.

     

    Please scroll down past this worksheet layout.

     

    image.thumb.png.60ffb43335ba4a99b8a009cbd6c9befb.png

     

    Then I tried writing a macro. On it's own ( with WSScript_SetResStr (Num2Str (0, n)); replaced with Message (n)), it returns 32, which is the sum of cells B12 to B16. Nice.

     

    However, calling it with  =RUNSCRIPT('Total Items')  in cell G3, it crashes VW.

     

    If I put  =RUNSCRIPT('Total Items')  in B17, and =B17 in G3, it makes a mess.

     

    Any ideas or reasons would be appreciated.

     

    procedure Total_Items;
    var
    i : integer;
    n, V : real;
    h : handle;
    
    begin
    h := GetObject ('Grating - Fabrication List');
    for i := 12 to 16 do
    	begin
    	GetWSCellValue (h, i, 2, V);
    	n := n + V;
    	end;
    	
    WSScript_SetResStr (Num2Str (0, n));
    end;
    run (Total_Items);

     

  13. So, finding a work around wasn't that difficult. This is how I solved it for those interested.

     

    The reason for making a Database line was to get the Record Value from an object, with a record attached, and list it on the same row as the Logo.

     

    The row must be of Spreadsheet type, and then the cell value   =IMAGE(N='Logo')   works.

     

    I wrote this macro and the added this formula to a cell to the right of the Logo      =RUNSCRIPT('Name of script')

     

    Many of you will recognize the method.

     

    procedure Fab_List_Value;
    
    	procedure Get_Value (h : handle);
    	var V : string;
    	begin
    	V := Concat (GetRField (h, 'Value', 'GrWeight'), ' ', GetRField (h, 'Value', 'NtWeight'));
    	WSScript_SetResStr (V);
    	end;
    	
    begin
    ForEachObject (Get_Value, ((L = 'Objects') & (C = 'Object1')));
    end;
    run (Fab_List_Value);

     

     

    • Like 1
×
×
  • Create New...