DESCTIVATING A CUTPLANE FROM 2D SCRIPT or similar method

Home Forums Problems and solutions in GDL 3D modelling DESCTIVATING A CUTPLANE FROM 2D SCRIPT or similar method

Viewing 10 reply threads
  • Author
    Posts
    • #4532
      Nader Belal
      Participant

      Hi there,

      I´ve created a complex object that is being controlled by a myriad of parameters and conditions (basically a sandwich panel with an arbitrary number of holes and shapes with the ability to trim the corners at an angle defined by the user, and the ability to receive gabled roof; all at the desired LOD) . . . so to create an accurate plan view I have used CUTPLANE in the “3D script” and used PROJECT2{4} in the “2D script

      My problem have started when I wanted to include an elevation view on plan (similar to ArchiCAD’s wall accesory object for wood frame walls) since I have use this code:

      Project2 4, 270, 2
      

      As expected, the views I got is that of the panel with the part above the CUTPLANE trimmed.

      And I can not stop the use of CUTPLANE predefined in the “3D script” since that PROJECT2{4} will not show correctly the different types of voids applied to the panel (at least the different skins and building materials applied to them in the “3D script)

      So I need this, either:
      a) A condition that can deactivates the CUTPLANE in the “3D script” when the user asks for an elevation view on Plan.
      b) Or another way to create the cut plane view that doesn’t scripting the view (due to the associated difficulty) and doesn’t need a cut plane.
      c) or any other method capable of achieving the desired result.

      This issue have been also been discussed in this thread (https://archicad-talk.graphisoft.com/viewtopic.php?f=6&t=66286), but not the needed results until the time I have written this thread in the GDL center.

      Worth to mention that other tried issues where:
      a) A condition in 2D to activate/deactivate the CUTPLANE in the “3D script“.
      b) A routine that in the “3D script” one with the CUTPLANE activated, and another deactivated.
      c) Passing the CUTPLANE and PROJECT2{4} ****** to “Master Script
      d) Passing the 3D modelling procedures of the object to the Master Script******.

      ******
      When I passed the CUTPLANE and PROJECT2{4} to the “3D script“, the ENDPLANE caused PROJECT2{4} to give unexpected results, please see the thread above for more info.

    • #4533
      Barry Kelly
      Participant

      So I need this, either:
      a) A condition that can deactivates the CUTPLANE in the “3D script” when the user asks for an elevation view on Plan.

      I assume the showing of the elevation in plan view is a parameter option.
      I would then do this.

      if elevation_in_plan = 1 and GLOB_VIEW_TYPE = 2 then				!Plan view
      !!!!do nothing
      else
            CUTPLANE 0, cutplane_height
      endif
      
      ... 3D model script ...
      
      if elevation_in_plan = 1 and GLOB_VIEW_TYPE = 2 then				!Plan view
      !!!!do nothing
      else
            CUTEND
      endif

      I am sure it could be scripted differently.

      Barry.

      Versions 6.5 to 22
      Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
      Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

    • #4537
      Nader Belal
      Participant

      Nader Belal wrote:
      So I need this, either:
      a) A condition that can deactivates the CUTPLANE in the “3D script” when the user asks for an elevation view on Plan.

      Sorry my bad …

      I needed to deactivate the CUTPLANE in the “3D Script” if the user need an elevation view on the plan, but on the same time mantaining the cut plan view of the object.

      I have already solved this issue in this post https://archicad-talk.graphisoft.com/viewtopic.php?p=294857#p294857, and I recognise that it’s not the best nor the more efficent way to do it, but I would gladly like to hear your opinion.

    • #4538
      Péter Baksa
      Keymaster

      Hi,

      in 3D script, GLOB_VIEW_TYPE is 2 when the 3D script is run for project2. That’s what Barry’s example does, too.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #4545
      Nader Belal
      Participant

      I will try make myself clear again.

      I need to create a cut plan view in plan AND an elevation view on plan at the same time.

      My problem is that with a CUTPLANE active in the “3D Script” will generate an elevation view on plan with it’s upper part is cut.
      And if I deactivate CUTPLANE in the “3D Script” the section plan view will not show correctly.

      I need both right at the same time … How ?

    • #4549
      Barry Kelly
      Participant

      If you can get the correct views with the cutting planes in the PROJECT2 command then in the 2D script you use it twice.

      PROJECT2 - top view with desired cutting planes
      if show_elevation = 1 then
          ADD2 x,y
          PROJECT2 - side view with desired cutting planes
          DEL 1
      endif

      If you need to use an actual CUTPLANE in the 3D script to get the projection you want then use the if/then command to control the CUTPLANE and CUTEND as I mensiomed before (but you won’t need the GLOB_VIEW_TYPE = 2).
      The thing is you will need to turn off the CUTPLANE for one of the passes.
      Again this may not be the best scripting but I would do this.

      show_elevation_orig = show_elevation
      show_elevation = 0   !!!!temporarily turn of show in elevation mode
      PROJECT2 - top view with or without built in cutting planes
      show_elevation = show_elevation_orig   !!!!set elevation mode back to original
      
      if show_elevation = 1 then
          ADD2 x,y
          PROJECT2 - side view with or without built in cutting planes
          DEL 1
      endif

      Barry.

      Versions 6.5 to 22
      Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
      Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

    • #4556
      Nader Belal
      Participant

      Ok I will try that.

    • #4560
      Péter Baksa
      Keymaster

      Parameters and variables set in the 2D script doesn’t get through via project2 to the 3D script.

      You can define cutplanes in the 2D script using the PROJECT2{4} command. Unfortunately it has a bug, so it doesn’t show correct cut fills from the 3D model. You can set a cut fill override if you need only one cut fill.

      You can also use PROJECT2{3} with PARAMETERS, setting a hidden parameter whether you need the cutplane or not.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #4562
      Nader Belal
      Participant

      @Péter Baksa

      Are you telling me that in my case, the best solution (actually second best) available for me now, is to make a 2nd copy of the object in the 3D script, and use the same project2{what ever version} to get the cut plan view and and elevation view at the same time ???!!!!

    • #4566
      Péter Baksa
      Keymaster

      Hi Nader,

      yes, that could also work with the simple project2. Or you could project2{3} … parameters … twice.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #4569
      Nader Belal
      Participant

      Thank you

Viewing 10 reply threads
  • The forum ‘3D modelling’ is closed to new topics and replies.