Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

224 Spectacular


About twk

  • Rank
    500 Club

Personal Information

  • Occupation
    Architectural Designer
  • Homepage
  • Location
    New Zealand

Recent Profile Visitors

2,667 profile views
  1. twk

    Data Tags

    h = Data Tag Object Handle import vs; def GetTaggedObject(h): result = False; num = vs.GetNumAssociations(h); assH = None assKind = None value = None i = 0; while(i < num and result == False): assH, assKind, value = vs.GetAssociation(h, i); if (assKind == 37): result = True; i = i + 1; return result, assH;
  2. twk

    Formatting OIP?

    My python work-in-progress template: def __temp_funcs(self): kObjXPropEditGroup = vs.SetObjPropVS(1, True) # -- Object has non-default "Enter Group" behavior. PIO objects can enter the profile or path group kObjXPropHasLayerScaleDeps = vs.SetObjPropVS(2, True) # -- Object wants to be reset with when its layer scale changes. kObjXPropPreference = vs.SetObjPropVS(4, True) # -- Object Definition Procedure (ODP) handles ParametricPreferencesMessage::kAction event. kObjXPropDirectModeling = vs.SetObjPropVS(5, True) # -- Object Definition Procedure (ODP) handles handles Direct Modeling events. kObjXPropAttributeTool = vs.SetObjPropVS(6, True) # -- Object Definition Procedure (ODP) handles handles Attribute Mapping events. kObjXPropCustomCursorResize = vs.SetObjPropVS(9, True) # -- // // boolean value // // The O kObjXPropDefaultPropertyUI = vs.SetObjPropVS(11, True) # -- // // unsigned char // // The bits in this property describe the UI displayed kObjXPropCustomHideFactor = vs.SetObjPropVS(16, True) # -- The parametric object provides custom scale threshold to be used to hide inner objects kObjXHasCustomWidgetValues = vs.SetObjPropVS(17, True) # -- OnObjectWidgetValueCall::kAction kObjXPropAcceptStates = vs.SetObjPropVS(18, True) # -- The parametric accpets ObjectState::kAction event kObjXPropPreserveContents = vs.SetObjPropVS(20, True) # -- VectorWorks will not delete the contents of the parametric kObjXPropHasContextMenu = vs.SetObjPropVS(21, True) # -- Sends ObjectContextMenuEvent::kAction_Init and ObjectContextMenuEvent::kAction_Event kObjXPropResetBeforeExport = vs.SetObjPropVS(23, True) # -- This plugin will be reset before Print or Export kObjXPropRedSymbolIsStyle = vs.SetObjPropVS(25, True) # -- Red Symbol of this object can be used to drag&drop kObjXPropHasAttrMappingGeom = vs.SetObjPropVS(26, True) # -- Sends ObjectGetSpecificGeometryCall::kAction with message is (OnObjectGetSpecificGeometry*) kObjXPropHasSectionVPGeom = vs.SetObjPropVS(27, True) # -- Sends ObjectGetSpecificGeometryCall::kAction with message is (OnObjectGetSpecificGeometry*) kObjXPropHasLayerElevDeps = vs.SetObjPropVS(28, True) # -- Resets the parametric if the layer elevation changes kObjXPropHasLayerHeightDeps = vs.SetObjPropVS(29, True) # -- Resets the parametric if the layer height changes kObjXPropLeaderLinePtIndex = vs.SetObjPropVS(33, True) # -- Controls whether how and a paremetric will be recognized by the align leader line menu command kObjXPropLabelPtIndex = vs.SetObjPropVS(34, True) # -- Controls whether how and a paremetric will be recognized by the align leader line menu command kObjXPropDataNameDisabled = vs.SetObjPropVS(35, True) # -- Controls whether the name field on the data pane should be disabled kObjXPropDirectionArrow = vs.SetObjPropVS(39, True) # -- Controls whether the direction arrow should be displaied kObjXPropIsSymbolBased = vs.SetObjPropVS(40, True) # -- Controls whether the object is symbol based and to show context menu "Locate Symbol In Resource Browser" kObjXPropTextStyleSupport = vs.SetObjPropVS(42, True) # -- Controls whether parametric objects can use class text style attribute and get Text Style on OIP kObjXPropDontShowZLocation = vs.SetObjPropVS(45, True) # -- When set to true will remove the Z coordinate for the location widget in the OIP for the parametric kObjXPropGetDragEvents = vs.SetObjPropVS(47, True) # -- Controls whether a parametric will recieve Drag events allowing it to draw custom geometry kObjXPropOIPNameHidden = vs.SetObjPropVS(48, True) # -- Controls whether the name field on the OIP should be hidden kObjXSupportsStyles = vs.SetObjPropVS(49, True) # -- Controls whether a parametric type support plug-in styles kObjXPropUseLayerCutPlane = vs.SetObjPropVS(51, True) # -- Controls whether a parametric object supports Layer Cut Plane values. kObjXPropAllowFreeHybrid2DPath = vs.SetObjPropVS(52, True) # -- Controls whether a Hybrid 2D Path parametric can have a path on a different plane than the object kObjXCatalogSupport = vs.SetObjPropVS(63, True) # -- Controls whether a parametric type supports catalogs kObjXPropDontShowTextureWidgets = vs.SetObjPropVS(64, True) # -- When set to true will remove the texture widgets in the Render pane of OIP for the parametric object kObjXPropHidePlanarDropDown = vs.SetObjPropVS(71, True) # -- When set to true will hide planar dropdown for the widget in the OIP for the parametric
  3. twk

    Formatting OIP?

    I have a set one up similar to one Josh had posted somehwere before. Could I have a peak at yours Josh, to compare? Por Favor ūüėÄ
  4. twk

    Type 32?

    The parent of an object in the annotation space is the Annotation Group (Type 11=Group), Viewports have multiple components of itself > Eg. https://developer.vectorworks.net/index.php/VS:GetVPGroup To get the Viewport you use GetVPGroupParent (https://developer.vectorworks.net/index.php/VS:GetVPGroupParent). -edit- as to what a Header type is, I don't know. Full type list of objects is in the C++ SDK.
  5. We layer reference in the design layer, then viewport that onto the master/overall layer. Cumbersome I know, but that workflow, works for us.
  6. We use DLVP's as well. The brain wrecking part is when you have to do window and door schedules in this scenario. e.g You have an overall plan (Design Layer) that contains different floor plan types (in this case, in the form of Design Layer Viewports). When it comes to scheduling doors/windows, if these are in the DLVP's, then your schedule would have to calculate what viewport types are on that overall plan, and then calculate what window types belong to that particular plan type. A simple terrace housing complex is ok. Up scale that to a six story complex with 8 plan types mixed in at each level, and your in a living nightmare. We've alleviated that particular scenario through custom scripting, but if the new Unit Plan methodology would be able to cater for this that would be great.
  7. I wonder if Unit Plans means having say, apartment 'types' in an Apartment complex project. Maybe a mix between symbol functionality and viewport functionalities? Think 'Plugin Styles' but for floor plans? Who knows, the terminology is very vague. The renovation phasing feature in Archicad seems promising though.
  8. 1. 3D Structural Grid.. YES! 2. Materials - sounds good in demo vid and concept, but will wait for release to believe it! Ha! 3. Type Legends - couldn't come soon enough.. but she did use a keyword "in the future", so maybe not next release..
  9. Yes, above script is a snippet of the working script, all is working well now. My problem was incorrectly setting default values. I have now managed to complete our revision cloud tool to pull and push data to the new titleblocks. Cheers
  10. Apologies, my record handle for setting default values was wrong. vs.SetRField(self.plugin_object.record_def_handle, self.plugin_object.plugin_name, self.parameter_name, value) self.plugin_object.record_def_handle should be calling vs.GetObject(vs.GetName(vs.GetParametricRecord(self.handle))), not vs.GetParametricRecord(self.handle). Full script below: import vs alert_dialog = lambda x:vs.AlrtDialog(str(x)) class PluginObject(): class PluginParameter(): def __init__(self, plugin_object, parameter_name:str): self.plugin_object = plugin_object #type: PluginObject self.parameter_name = parameter_name def __str__(self): return "{}".format(self.parameter_name) @property def value(self): return vs.GetRField(self.plugin_object.handle, self.plugin_object.plugin_name, self.parameter_name) @value.setter def value(self, value): vs.SetRField(self.plugin_object.handle, self.plugin_object.plugin_name, self.parameter_name, value) vs.ResetObject(self.plugin_object.handle) @property def value_default(self): return vs.GetRField(self.plugin_object.record_def_handle, self.plugin_object.plugin_name, self.parameter_name) @value_default.setter def value_default(self, value): vs.SetRField(self.plugin_object.record_def_handle, self.plugin_object.plugin_name, self.parameter_name, value) vs.ResetObject(self.plugin_object.handle) def __init__(self, handle): self.handle = handle self.record_handle = vs.GetParametricRecord(self.handle) self.record_def_handle = vs.GetObject(vs.GetName(self.record_handle)) self.plugin_name = vs.GetName(self.record_handle) @property def list_parameters(self): data = [] for x in range(vs.NumFields(self.record_handle)): fldname = vs.GetFldName(self.record_handle, x+1) data.append(PluginObject.PluginParameter(self,fldname)) return data def get_parameter_by_name(self, parameter_name:str): for x in self.list_parameters: if x.parameter_name == parameter_name: return x tb = PluginObject(vs.FSActLayer()) revision_mark = tb.get_parameter_by_name('Revision Mark') revision_mark.value_default = 'Numbers' alert_dialog(revision_mark.value_default)
  11. We too have setup automatic revision control internally and externally of vectorworks. However with the new 2019 Titleblock, I can't seem to set Revision Increment value to Manual or Auto through script (vs.SetRField). Tried: - Set Plugin Default field value - Setting value/default value throughout all Titleblocks in document - Setting value/default value throughout all Plugin Style Titleblocks in document What is the logic here? @Nikolay Zhelyazkov
  12. import pandas as pd import vs import os layer = "AC_Parcel_polygon" # pass in whatever layer name your polygons are on criteria = "(((T=POLY)|(T=POLYLINE)) & (L='{}'))".format(layer) # criteria string that finds polygons, polylines on layer=layer polygons = [] # list to store polygons def collect_polygons(h): polygons.append(h) vs.ForEachObject(collect_polygons, criteria) # use ForEachObject to collect polygons # code to store polygon data in pandas datatframe, # Format= # row_index, Polygon Index, Polygon Vertex Index, Polygon Vertex Type, Polygon Vertex Radius databased_polygons = [] for i, poly in enumerate(polygons): vertices = vs.GetVertNum(poly) for v_index in range(vertices): vrtxPt, vrtxType, vrtxRadius = vs.GetPolylineVertex(poly, v_index+1) databased_polygons.append([i, v_index, vrtxPt, vrtxType, vrtxRadius]) columns = ["Polygon Index", "Vertex Index", "Vertex Type", "Vertex Type", "VertexRadius"] dataframe = pd.DataFrame(databased_polygons, columns=columns) script_path = '' # enter dir path here to store csv file dataframe.to_csv(os.path.join(script_path, "Polygons.csv")) # store dataframe in csv for external checking print(dataframe) raise Exception # raise exception to see print data in error console in vectorworks
  13. If I am understanding your question correctly, you're wanting to grab the polygon vertex information, and transfer them to a pandas dataframe? If so: 1. You run a criteria to collect all the polygons that you're wanting 2. Then use vs.GetPolylineVertex(obj, vertexNum) to grab the coordinates of each vertex, collect those vertices coordinates and place in dataframe. I will have a go at it later this evening..
  14. twk

    Progress Dialog

    Ahh thats a shame, I shall explore some external python libraries.. WxPython, TKinter etc. This still happens sadly..


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...