Compare commits

...

17 Commits

Author SHA1 Message Date
Oğuzhan Koral 2ce3e9150f Release 2.13 2023-03-24 18:08:26 +03:00
Oğuzhan Koral 8e39832d3e Fix (Instancing): Definition uniqueness for mirrored definitions 2023-03-20 22:14:10 +03:00
oguzhankoral ce7ac6da16 Create definitions with it's id 2023-03-20 22:11:52 +03:00
oguzhankoral 57879a57cd Enable conversion for full assembly name block instance 2023-03-20 22:05:42 +03:00
Oğuzhan Koral 6f5b367028 Fix (Revit): Do not create layers in advance for revit receives 2023-03-20 13:04:42 +03:00
oguzhankoral 291948c1ef Do not create layers in advance for revit receives 2023-03-20 12:57:26 +03:00
Oğuzhan Koral 0ca6888fb1 Fix (Instancing): Support nested families re-fix 2023-03-20 10:56:50 +03:00
oguzhankoral 5e92236396 Remove skp attributes from transform 2023-03-20 10:45:45 +03:00
oguzhankoral 28db40112b Collect revit elements also into displayValue to handle later 2023-03-20 10:45:13 +03:00
Oğuzhan Koral b2153883ef Revert "Fix (Instancing): Support nested families" 2023-03-16 18:28:44 +03:00
Oğuzhan Koral 807cbeb75d Revert "Fix (Instancing): Support nested families" 2023-03-16 18:28:14 +03:00
Oğuzhan Koral 4730aebdc6 Fix (Instancing): Support nested families 2023-03-16 18:06:50 +03:00
oguzhankoral c2279eec87 Add elements of revit_definition to display value to handle all 2023-03-16 18:03:21 +03:00
Oğuzhan Koral f5567ae9ad Chore (Mixpanel): Send isMultiplayer parameter with Receive action 2023-03-16 11:50:45 +03:00
oguzhankoral 2fcba04cf5 Pass sourceHostApp with slug and sourceHostAppVersion full info on commit
For "Revit2022",
sourceHostApp: "revit"
sourceHostAppVersion: "Revit2022"
2023-03-16 11:13:49 +03:00
oguzhankoral 0eefd1605f Add static HostApplication instances per connector
- This helps to retrieve name and slug of the connector
2023-03-16 11:12:29 +03:00
oguzhankoral 7b88ea022d Send isMultiplayer parameter with Receive action 2023-03-15 12:35:57 +03:00
6 changed files with 99 additions and 6 deletions
@@ -11,6 +11,7 @@ module SpeckleConnector
OBJECTS_GEOMETRY_BREP = 'Objects.Geometry.Brep'
OBJECTS_OTHER_BLOCKINSTANCE = 'Objects.Other.BlockInstance'
OBJECTS_OTHER_BLOCKINSTANCE_FULL = 'Objects.Other.Instance:Objects.Other.BlockInstance'
OBJECTS_OTHER_INSTANCE = 'Objects.Other.Instance:Objects.Other.Instance'
OBJECTS_OTHER_REVIT_REVITINSTANCE = 'Objects.Other.Revit.RevitInstance'
OBJECTS_OTHER_BLOCKDEFINITION = 'Objects.Other.BlockDefinition'
@@ -55,6 +55,7 @@ module SpeckleConnector
Objects.Other.Revit.RevitInstance
Objects.Other.BlockDefinition
Objects.Other.RenderMaterial
Objects.Other.Instance:Objects.Other.BlockInstance
].freeze
def from_revit
@@ -73,7 +74,7 @@ module SpeckleConnector
# First create layers on the sketchup before starting traversing
# @Named Views are exception here. It does not mean a layer. But it is anti-pattern for now.
filtered_layer_containers = obj.keys.filter_map { |key| key if key.start_with?('@') && key != '@Named Views' }
create_layers(filtered_layer_containers, sketchup_model.layers)
create_layers(filtered_layer_containers, sketchup_model.layers) unless from_revit
# Convert views to sketchup scenes
SpeckleObjects::BuiltElements::View3d.to_native(obj, sketchup_model)
# Get default commit layer from sketchup model which will be used as fallback
@@ -313,6 +314,7 @@ module SpeckleConnector
OBJECTS_GEOMETRY_BREP => MESH.method(:to_native),
OBJECTS_OTHER_BLOCKDEFINITION => BLOCK_DEFINITION.method(:to_native),
OBJECTS_OTHER_BLOCKINSTANCE => BLOCK_INSTANCE.method(:to_native),
OBJECTS_OTHER_BLOCKINSTANCE_FULL => BLOCK_INSTANCE.method(:to_native),
OBJECTS_OTHER_REVIT_REVITINSTANCE => REVIT_INSTANCE.method(:to_native),
OBJECTS_OTHER_RENDERMATERIAL => RENDER_MATERIAL.method(:to_native)
}.freeze
@@ -16,12 +16,13 @@ module SpeckleConnector
type = def_obj['type']
category = def_obj['category']
return "#{family}-#{type}-#{category}"
return "#{family}-#{type}-#{category}-#{def_obj['id']}"
end
def self.to_native(state, definition, layer, entities, &convert_to_native)
definition_name = get_definition_name(definition)
definition['name'] = definition_name
definition['displayValue'] += definition['elements'] unless definition['elements'].nil?
BlockDefinition.to_native(state, definition, layer, entities, &convert_to_native)
end
end
@@ -11,8 +11,7 @@ module SpeckleConnector
# @param units [String] units of the transform.
# @param value [Array<Numeric>] values of the transform.
# @param sketchup_attributes [Other::BlockDefinition] sketchup attributes of the transform.
def initialize(units:, value:, sketchup_attributes: {})
def initialize(units:, value:)
super(
speckle_type: SPECKLE_TYPE,
total_children_count: 0,
@@ -21,7 +20,6 @@ module SpeckleConnector
)
self[:units] = units
self[:value] = value
self[:sketchup_attributes] = sketchup_attributes
end
def self.from_transformation(transformation, units)
+6 -1
View File
@@ -161,6 +161,7 @@ import gql from 'graphql-tag'
import { bus } from '../main'
import streamQuery from '../graphql/stream.gql'
import ObjectLoader from '@speckle/objectloader'
import {HostApplications} from '@/utils/hostApplications'
global.convertedFromSketchup = function (streamId, batches, commitId, totalChildrenCount) {
bus.$emit(`sketchup-objects-${streamId}`, batches, commitId, totalChildrenCount)
@@ -376,7 +377,11 @@ export default {
async receive() {
this.loadingStage = 'requesting'
this.loadingReceive = true
this.$mixpanel.track('Receive')
const selectedAccount = JSON.parse(localStorage.getItem('selectedAccount'))
const isMultiplayer = this.selectedCommit.authorId !== selectedAccount['userInfo']['id']
const sourceApp = this.selectedCommit.sourceApplication
const sourceAppSlug = HostApplications.GetHostAppFromString(sourceApp).slug
this.$mixpanel.track('Receive', { isMultiplayer: isMultiplayer, sourceHostApp: sourceAppSlug, sourceHostAppVersion: sourceApp})
const refId = this.selectedCommit?.referencedObject
if (!refId) {
this.loadingReceive = false
+86
View File
@@ -0,0 +1,86 @@
class HostApplication {
constructor(name, slug) {
this.name = name;
this.slug = slug;
}
}
/**
* Static class to retrieve host application names and their shortened name(slug).
* Call HostApplications.GetHostAppFromString(appname) method to get name and slug.
* @example
* const hostApp = HostApplications.GetHostAppFromString("Revit2022")
* console.log(hostApp.name) -> "Revit"
* console.log(hostApp.slug) -> "revit"
*/
export class HostApplications {
static Rhino = new HostApplication("Rhino", "rhino");
static Grasshopper = new HostApplication("Grasshopper", "grasshopper");
static Revit = new HostApplication("Revit", "revit");
static Dynamo = new HostApplication("Dynamo", "dynamo");
static Unity = new HostApplication("Unity", "unity");
static GSA = new HostApplication("GSA", "gsa");
static Civil = new HostApplication("Civil 3D", "civil3d");
static AutoCAD = new HostApplication("AutoCAD", "autocad");
static MicroStation = new HostApplication("MicroStation", "microstation");
static OpenRoads = new HostApplication("OpenRoads", "openroads");
static OpenRail = new HostApplication("OpenRail", "openrail");
static OpenBuildings = new HostApplication("OpenBuildings", "openbuildings");
static ETABS = new HostApplication("ETABS", "etabs");
static SAP2000 = new HostApplication("SAP2000", "sap2000");
static CSIBridge = new HostApplication("CSIBridge", "csibridge");
static SAFE = new HostApplication("SAFE", "safe");
static TeklaStructures = new HostApplication("Tekla Structures", "teklastructures");
static Dxf = new HostApplication("DXF Converter", "dxf");
static Excel = new HostApplication("Excel", "excel");
static Unreal = new HostApplication("Unreal", "unreal");
static PowerBI = new HostApplication("Power BI", "powerbi");
static Blender = new HostApplication("Blender", "blender");
static QGIS = new HostApplication("QGIS", "qgis");
static ArcGIS = new HostApplication("ArcGIS", "arcgis");
static SketchUp = new HostApplication("SketchUp", "sketchup");
static Archicad = new HostApplication("Archicad", "archicad");
static TopSolid = new HostApplication("TopSolid", "topsolid");
static Python = new HostApplication("Python", "python");
static NET = new HostApplication(".NET", "net");
static Navisworks = new HostApplication("Navisworks", "navisworks");
static AdvanceSteel = new HostApplication("Advance Steel", "advancesteel");
static Other = new HostApplication("Other", "other");
static GetHostAppFromString(appname){
if (!appname) return HostApplications.Other;
appname = appname.toLowerCase().replace(/ /g, "");
if (appname.includes("dynamo")) return HostApplications.Dynamo;
if (appname.includes("revit")) return HostApplications.Revit;
if (appname.includes("autocad")) return HostApplications.AutoCAD;
if (appname.includes("civil")) return HostApplications.Civil;
if (appname.includes("rhino")) return HostApplications.Rhino;
if (appname.includes("grasshopper")) return HostApplications.Grasshopper;
if (appname.includes("unity")) return HostApplications.Unity;
if (appname.includes("gsa")) return HostApplications.GSA;
if (appname.includes("microstation")) return HostApplications.MicroStation;
if (appname.includes("openroads")) return HostApplications.OpenRoads;
if (appname.includes("openrail")) return HostApplications.OpenRail;
if (appname.includes("openbuildings")) return HostApplications.OpenBuildings;
if (appname.includes("etabs")) return HostApplications.ETABS;
if (appname.includes("sap")) return HostApplications.SAP2000;
if (appname.includes("csibridge")) return HostApplications.CSIBridge;
if (appname.includes("safe")) return HostApplications.SAFE;
if (appname.includes("teklastructures")) return HostApplications.TeklaStructures;
if (appname.includes("dxf")) return HostApplications.Dxf;
if (appname.includes("excel")) return HostApplications.Excel;
if (appname.includes("unreal")) return HostApplications.Unreal;
if (appname.includes("powerbi")) return HostApplications.PowerBI;
if (appname.includes("blender")) return HostApplications.Blender;
if (appname.includes("qgis")) return HostApplications.QGIS;
if (appname.includes("arcgis")) return HostApplications.ArcGIS;
if (appname.includes("sketchup")) return HostApplications.SketchUp;
if (appname.includes("archicad")) return HostApplications.Archicad;
if (appname.includes("topsolid")) return HostApplications.TopSolid;
if (appname.includes("python")) return HostApplications.Python;
if (appname.includes(".net")) return HostApplications.NET;
if (appname.includes("navisworks")) return HostApplications.Navisworks;
if (appname.includes("advancesteel")) return HostApplications.AdvanceSteel;
return appname;
}
}