Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Story sensitive object with smooth option

Anonymous
Not applicable
Hello!
I am using Archicad 13 for a couple of months and i have recently discovered its potential to work with imported models from other softwares like Rhino or Cinema 4D. I am trying to find a workflow where i can create models in Rhino (and Grasshopper eventually) as complex envelopes/shapes for the exterior of the building and then refine and document the rest of the project within Archicad.
I believe this workflow has`nt been that easy before implementing the Cinema 4D Exchange plugin because of the storysensitive planview issue.
Now i just found out that a 3DS model imported in Archicad when sent to C4D and then back , will become storysensitive wich is great.
The problem is that it looses the "force smooth" property wich the 3DS import has.
My question is what is the workaround to add the smoothness property of the storysensitive object imported from C4D? I mean i would like the uncut surfaces to be seen without those edges of polygons, except for the countours. Just like the 3DS imported object but with cutplane sensitiity.

It has something to do with the 3D script pehaps? Or also in 2D script?

I am not proficient in gdl but i could manage to insert or change some lines.
Thank you !
27 REPLIES 27
Anonymous
Not applicable
I'm not sure about the import/export options/issues, but since it seems you can get the smooth part into ArchiCAD you can make it story sensitive and get the floor plan cutplane(s) correct with a bit of scripting. It's slightly advanced but actaully pretty simple.

Replace the graphic part of 2D script with the Project2 function. (There may be useful hotspots you want to retain.) This will cause the script to use a top view projection of the 3D as the plan symbol.

At the very beginning of the 3D script use:
IF GLOB_CONTEXT = 2 THEN
    addz plan_cut_height    ! derived from global parameters according to your needs
    CUTPLANE    ! in this form it simply cuts away anything above the XY plane
    del 1
ENDIF
The GLOB_CONTEXT condition means it will only run when called from the 2D script. At the end of the script you will need:
IF GLOB_CONTEXT = 2 THEN CUTEND
This ends the cutting plane.

You will also need to calculate the cutting height according to the home story, current story and floor plan cutplane global parameters. There may be a bit more tweaking to get the story sensitivity right. I don't know your exact requirements and it's been a while since I've written one of these.
Anonymous
Not applicable
Thanks for the reply Mathew. That would be another alternative even though the automatic scripting of the C4D exchange is great except for the smoothing thing.
Regarding the script for manually make it story sensitive, i have actually found a post here wich is even more flexible and reacts to the global cutplane settings. [url] http://195.144.20.106/viewtopic.php?p=138982&highlight=cutplane+gdl&sid=6554c87aef302866c74f8602654d...

First add a parameter for turning off or on the storysensitive function then in the begining of the 2D script should be this:
if StorySensitive then 
   dummyvar = GLOB_CSTORY_ELEV 
   project2 3,270,1   !  if you replace 1 with 2, becomes hidden line wich is what i wanted!
   end 
endif
At the begining of the 3D script :
if StorySensitive and GLOB_CONTEXT = 2 then 
   add 0,0,GLOB_CUTPLANES_INFO[1] + GLOB_CSTORY_ELEV - GLOB_HSTORY_ELEV 
   cutplane 
   del 1 
   if CutBelow then 
      cutbottom = max(GLOB_CUTPLANES_INFO[3]+GLOB_CSTORY_ELEV-GLOB_HSTORY_ELEV,GLOB_CUTPLANES_INFO[4]) 
      add 0,0,cutbottom 
      mulz -1 
      cutplane 
      del 2 
   endif 
endif 
And at the end of the 3D script:

if StorySensitive and GLOB_CONTEXT = 2 then 
   cutend 
   if CutBelow then 
      cutend 
   endif 
endif
I don`t know what dummyvar means. Anyway i succeded to make it cutplane sensitive but now i have to insert the foloowing parameters : uncut linetype
uncut pen
cut pen,
cut linetype
cut fill

Can you tell me where i should insert them and wich is the syntax?
story-sensitive-witth_and_smooth.jpg
Anonymous
Not applicable
Looks good. I didn't know your level of GDL expertise so I was keeping it simple (and saving some time). Cheers
TMA_80
Enthusiast
it the same problem when importing skeychup object ArchiCAD triangulate all the faces , the force smooth option from the 3ds addon would be great for both cases (yours and sketchup objects )
AC12_20 |Win10_64bit|
Anonymous
Not applicable
Well i am almost zero in GDL experience but i`v just managed to understand a few lines and did some copy paste.
The smooth thing option is really a mistery. I wonder where it stays on the GDL script. Maybe by studying the C4D exchange script i could find an answer.
However the C4D script isn`t easy. Still, i think i have found the part where it defines the Projected view (wich means cutplane sensitive)
==============================================================================
! Projected Views
! ==============================================================================

gs_cutplane_height = GLOB_CSTORY_ELEV - GLOB_HSTORY_ELEV + GLOB_CUTPLANES_INFO[1]
gs_top_range_height = GLOB_CSTORY_ELEV - GLOB_HSTORY_ELEV + GLOB_CUTPLANES_INFO[2]
if gs_symb_show_projection_to = stProjectionTypes[1] then
	gs_bottom_range_height = GLOB_CSTORY_ELEV - GLOB_HSTORY_ELEV + GLOB_CUTPLANES_INFO[3]   ! To Floor Plan Range
else
	gs_bottom_range_height = GLOB_CUTPLANES_INFO[4] ! Absolute Display Limit
endif

doCutplane = (AC_symb_display_option = 1 | AC_symb_display_option = 2)


		! Draw View Edges ==============================================================

pen AC_uncut_pen
line_type 1

if AC_symb_display_option = 5 then
	pen AC_overhead_pen
	line_type AC_overhead_linetype
endif

project2{3} 3,270,2+32  * (AC_symb_display_option = 5 | not(gs_use_3D_view_attributes)), 8,

parameters  gs_2D_projection        = doCutplane,
gs_2D_projection_type   = 1,
gs_cutplane_height      = gs_cutplane_height,
gs_top_range_height     = gs_top_range_height,
gs_bottom_range_height  = gs_bottom_range_height

I think the first part defines the cutplane settings wich is good.
But the answer for the smoothness issue is somehow related to this line?
project2{3} 3,270,2+32  * (AC_symb_display_option = 5 | not(gs_use_3D_view_attributes)), 8,
can somebody "translate it"?
Maybe if i could change a line or two in the C4D script i get what i want in an even easier way?
Anonymous
Not applicable
I have found a hint about the Project2{3} command here:
http://www.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/10/LibDevGuide/GDL_NewFeatures_10.html


PROJECT2{3} projection_code, angle, method, parts
[, backgroundColor, fillOrigoX, fillOrigoY, filldirection][[,]
PARAMETERS name1=value1 , ... namen=valuen

"project2{3}, adds the possibility to define which parts of the projected model are required and to control the attributes of the cut and view part separately, including the line type. You can also generate the projection with actual parameters set in the command"

It seems this new command incorporates the settings i am searching for?
Anonymous
Not applicable
I am updating again. I have found that the "method" parameter in the Project2 {3} command, has nothing to do with the smoothness of 3D object.
So i guess this issue is related to the actual 3D script . I should compare the 3D scripts of the C4D and 3DS import object. Does anybody knows more about this thing?
Anonymous
Not applicable
TMA_80 wrote:
it the same problem when importing skeychup object ArchiCAD triangulate all the faces , the force smooth option from the 3ds addon would be great for both cases (yours and sketchup objects )
This is why I use 3DS to get SketchUp models into ArchiCAD.
Anonymous
Not applicable
Coty82 wrote:
I am updating again. I have found that the "method" parameter in the Project2 {3} command, has nothing to do with the smoothness of 3D object.
So i guess this issue is related to the actual 3D script . I should compare the 3D scripts of the C4D and 3DS import object. Does anybody knows more about this thing?
You are right. The smoothness is determined in the 3D script. As I recall the Project2 {3} command just gives control over fills and pens for the plan view projection.

I don't know what the script from C4D import looks like but if it is binary then the options are very limited. If it is editable script it is theoretically possible to modify it but may be too difficult/problematic to be realistic.