Jump to content

Construction Phasing Data Visualization (Existing, Demo, New, NIC)


Recommended Posts

  • 4 weeks later...

Script has been modified to detect if Design Layers or Sheet Layer is active and Isolate modifications to the active layer type.  Also added the ability to modify objects within a Sheet Layer or Sheet Layer VP annotations.  Note that classes will need to be enabled in VP dialog after running script in VP annotations otherwise they may be hidden.  Only works on objects inserted in walls when design layer is active. 

 

"""
This script assigns selected objects to class "1_Exist-(original class)" and set Construction Phase to 'EXISTING TO REMAIN'.

If a in wall object is selected without selecting the wall the script will only change those in wall objects.
If a wall is selected it will change the wall and all objects inserted in that wall.
If New class does not exist objects original class is duplicated to retain class attributes.

To take full advantage of this script use "Data Visualization" to display the "Construction Phase"
  record objects as desired.
     1. Set "Data Visualization" to modify drawings per "Construction Phase" record
     2. To make a "Construction Phase" invisible set the attributes of that phase to:
           Line settings to Fill "Solid White" and Line weight "0"

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

Vectorworks bug does not show changes to symbols inserted in wall until either:
   Drawing is saved and reopened.
   Setting in Data Visualization dialog is changed.
   Symbol is removed from wall, can then be reinserted

David Hamer, 2020 revision 07-15-2020
"""

# Modifications to any objects happen here
def assign(h):
    CName = vs.GetClass(h)
    CLen = vs.Len(CName)
    CNameE = vs.Copy(CName, 1, 8)  # Grab First 8 letters of handle's class
    CNameD = vs.Copy(CName, 1, 7)  # Grab First 7 letters of handle's class
    if CNameD == '2_Demo-':  # Check if first 7 letters equal '2_Demo-'
        CName = vs.Copy(CName, 8, CLen)  # if true grab root name of class
    # check if the class is new, if so delete new class and duplicate objects class and rename.
    if CNameE == '1_Exist-':
        CNameN = CName
    else:
        CNameN = vs.Concat('1_Exist-', CName)  # If not add '1_Exist-' to name
    ClassCount = vs.ClassNum()  # determine number of classes in drawing
    vs.NameClass(CNameN)  # set the name of the class to be applied to handle if new class will be created
    if ClassCount + 1 == vs.ClassNum():  # check if the class is new and if delete new class and duplicate source
        vs.ReDraw()
        vs.DelClass(CNameN)  # Delete new class
        CHandle = vs.GetObject(CName)  # get handle to source class
        NDCHandle = vs.CreateDuplicateObject(CHandle, vs.GetParent(CHandle))  # duplicate source class
        vs.SetName(NDCHandle, CNameN)  # rename duplicate class to name to be applied to handle
        vs.ResetObject(NDCHandle)
        vs.ResetObject(h)
    vs.SetClass(h, CNameN)  # name handle's class
    vs.SetRecord(h, 'Construction Phase')  # add record to inserted object
    vs.SetRField(h, 'Construction Phase', 'Phase', 'EXISTING TO REMAIN')  # modify record to inserted object

 # Passes Handle to "def assign(h):" of PIO or Symbol selected
def pio_processing(h):
    global container  # declare global variable to be retained
    if vs.GetObjectVariableInt(vs.GetLayer(h), 154) == activetype:
        assign(h)  # Runs "def assign(h):"
        hParent = vs.GetParent(h)  # Get Parent handle
        itParent = vs.GetTypeN(hParent)  # Get Parent type
        if itParent != []:
            if itParent == 68:  # If Parent type is a wall set container to state PIOinwallwasdetected
                container = 'PIOinwallwasdetected'
            if itParent == 89:  # If Parent type is a round wall set container to state PIOinwallwasdetected
                container = 'PIOinwallwasdetected'

# Passes Handle to "def assign(h):" of every object except PIO and Symbols outside walls selected
def object_processing(h):
	if vs.GetObjectVariableInt(vs.GetLayer(h), 154) == activetype:
		assign(h)  # Runs "def assign(h):"
		h1 = vs.FIn3D(h)
		while h1 != []:
			if vs.GetObjectVariableInt(vs.GetLayer(h1), 154) == activetype:
				if vs.GetTypeN(h1) == 15:
					assign(h1)  # Runs "def assign(h):" on symbol inserted
				if vs.GetTypeN(h1) == 86:
					assign(h1)  # Runs "def assign(h):" on PIO inserted
			h1 = vs.NextObj(h1)

def sl_processing(h): # Omit's Viewports in Sheet Layers
	if vs.GetTypeN(h) != 122:
		assign(h) 

activetype = 1
container = 'none'  # Declare container var
ACName = vs.ActiveClass()  # Record name of active class
if vs.GetObject('Construction Phase') == ():  # Creates "Construction Phase" record if not present
	vs.NewField('Construction Phase', 'Phase', '<none>', 4, 0)
	
if vs.GetObjectVariableInt(vs.ActLayer(), 154) == 2:
	activetype = 2
	vs.ForEachObjectInLayer(sl_processing, 2, 0, 0)
else:
    # Passes Handle to "def pio_processing(h):" of PIO and Symbols selected
    vs.ForEachObject(pio_processing, "((((T=PLUGINOBJECT)|(T=SYMBOL)) & (V) & (SEL=TRUE)))")

    # Passes Handle to "def object_processing(h):" of objects selected except PIO and Symbols outside walls selected
    # Skipped if PIO or Symbol selected was in wall
    if container != 'PIOinwallwasdetected':
        vs.ForEachObject(object_processing, "(((T<>PLUGINOBJECT)&(T<>SYMBOL)&(T<>VIEWPORT) & (V) & (VSEL=TRUE)))")

vs.NameClass(ACName)  # Return active class

 

Edited by The Hamma
Link to comment
  • 5 weeks later...

Script has been edited to omit objects selected on layers that are visible but not editable because layer options are not set to "Show/Snap/Modify Others"

 

"""
This script assigns selected objects to class "1_Exist-(original class)" and set Construction Phase to 'EXISTING TO REMAIN'.

If a in wall object is selected without selecting the wall the script will only change those in wall objects.
If a wall is selected it will change the wall and all objects inserted in that wall.
If New class does not exist objects original class is duplicated to retain class attributes.

To take full advantage of this script use "Data Visualization" to display the "Construction Phase"
  record objects as desired.
     1. Set "Data Visualization" to modify drawings per "Construction Phase" record
     2. To make a "Construction Phase" invisible set the attributes of that phase to:
           Line settings to Fill "Solid White" and Line weight "0"

This Python Script may be freely distributed. No warranty provided.
Use at your own risk.

Vectorworks bug does not show changes to symbols inserted in wall until either:
   Drawing is saved and reopened.
   Setting in Data Visualization dialog is changed.
   Symbol is removed from wall, can then be reinserted

David Hamer, 2020 revision 08-13-2020
"""


# Modifications to any objects happen here
def assign(h):
    CName = vs.GetClass(h)
    CLen = vs.Len(CName)
    CNameE = vs.Copy(CName, 1, 8)  # Grab First 8 letters of handle's class
    CNameD = vs.Copy(CName, 1, 7)  # Grab First 7 letters of handle's class
    if CNameD == '2_Demo-':  # Check if first 7 letters equal '2_Demo-'
        CName = vs.Copy(CName, 8, CLen)  # if true grab root name of class
    # check if the class is new, if so delete new class and duplicate objects class and rename.
    if CNameE == '1_Exist-':
        CNameN = CName
    else:
        CNameN = vs.Concat('1_Exist-', CName)  # If not add '1_Exist-' to name
    ClassCount = vs.ClassNum()  # determine number of classes in drawing
    vs.NameClass(CNameN)  # set the name of the class to be applied to handle if new class will be created
    if ClassCount + 1 == vs.ClassNum():  # check if the class is new and if delete new class and duplicate source
        vs.ReDraw()
        vs.DelClass(CNameN)  # Delete new class
        CHandle = vs.GetObject(CName)  # get handle to source class
        NDCHandle = vs.CreateDuplicateObject(CHandle, vs.GetParent(CHandle))  # duplicate source class
        vs.SetName(NDCHandle, CNameN)  # rename duplicate class to name to be applied to handle
        vs.ResetObject(NDCHandle)
        vs.ResetObject(h)
    vs.SetClass(h, CNameN)  # name handle's class
    vs.SetRecord(h, 'Construction Phase')  # add record to inserted object
    vs.SetRField(h, 'Construction Phase', 'Phase', 'EXISTING TO REMAIN')  # modify record to inserted object


# Passes Handle to "def assign(h):" of PIO or Symbol selected
def pio_processing(h):
    global container  # declare global variable to be retained
    if vs.GetObjectVariableInt(vs.GetLayer(h), 154) == activetype:
        hSEL.append(h)   # adds to list
        hParent = vs.GetParent(h)  # Get Parent handle
        itParent = vs.GetTypeN(hParent)  # Get Parent type
        if itParent != []:
            if itParent == 68:  # If Parent type is a wall set container to state PIOinwallwasdetected
                container = 'PIOinwallwasdetected'
            if itParent == 89:  # If Parent type is a round wall set container to state PIOinwallwasdetected
                container = 'PIOinwallwasdetected'


# Passes Handle to "def assign(h):" of every object except PIO and Symbols outside walls selected
def object_processing(h):
    if vs.GetObjectVariableInt(vs.GetLayer(h), 154) == activetype:
        hSEL.append(h)  # adds to list
        h1 = vs.FIn3D(h)
        while h1 != []:
            if vs.GetObjectVariableInt(vs.GetLayer(h1), 154) == activetype:
                if vs.GetTypeN(h1) == 15:
                    hSEL.append(h1)  # adds to list
                if vs.GetTypeN(h1) == 86:
                    hSEL.append(h1)  # adds to list
            h1 = vs.NextObj(h1)


def sl_processing(h):  # Omit's Viewports in Sheet Layers
    if vs.GetTypeN(h) != 122:
        assign(h)

hSEL = [] # defines list to contain handles to all selected objects 
activetype = 1
container = 'none'  # Declare container var
ACName = vs.ActiveClass()  # Record name of active class
if vs.GetObject('Construction Phase') == ():  # Creates "Construction Phase" record if not present
    vs.NewField('Construction Phase', 'Phase', '<none>', 4, 0)

if vs.GetObjectVariableInt(vs.ActLayer(), 154) == 2:
    activetype = 2
    vs.ForEachObjectInLayer(sl_processing, 2, 0, 0)
else:
	# Passes Handle to "def pio_processing(h):" of PIO and Symbols selected
	vs.ForEachObject(pio_processing, "((((T=PLUGINOBJECT)|(T=SYMBOL)) & (V) & (SEL=TRUE)))")

	# Passes Handle to "def object_processing(h):" of objects selected except PIO and Symbols outside walls selected
	# Skipped if PIO or Symbol selected was in wall
	if container != 'PIOinwallwasdetected':
		vs.ForEachObject(object_processing, "(((T<>PLUGINOBJECT)&(T<>SYMBOL)&(T<>VIEWPORT) & (V) & (VSEL=TRUE)))")
	for h in hSEL:
		if vs.GetPrefInt(506) != 5:
			if vs.GetLayer(h) == vs.ActLayer():
				assign(h)
		else:
			assign(h)
				
vs.NameClass(ACName)  # Return active class

 

Edited by The Hamma
Link to comment
  • 7 months later...

@The Hamma

Hello

I am a Swiss VW-User.

I do appreciate your shared work.

Since I don't have any idea about scripting, I admire those who have these skills.

 

Could I kindly ask an information?:

Why does Data -Visualization of walls not work in section?

Hatch patterns do not show up the way they do in floor plans...

A door instead does appear correctly in floor and section...

What is the difference between a wall and a door regarding data visualization? 

 

Bildschirmfoto 2021-03-19 um 14.10.11.png

Bildschirmfoto 2021-03-19 um 14.13.39.png

Link to comment

VW uses a concept of "Hybrid Objects" to allow to allow a single object in the drawing to display differently in a Top/Plan view than in any other view. Think about a door inserted in a wall.  The Top/Plan ("screen plane" or 2D) representation of the object will show the door swing. In other views (and sections) you will get the "model" (3D) version of the object.

 

Since Sections are not Top/Plan view, they are going to display differently.

 

3D only object show as wireframe only when displayed in Top/Plan view.  You can make Symbols and manually add the screen plane objects to make the Top/Plan view display what you want, or you can use the Autohybrid command to automatically take a 3D object and add a Top/Plan version to it.

Link to comment

Pat answered the question well.  You can combat this with class settings and possibly layering viewports.   I would recommend watching the RENDERING FOR EVERYDAY ARCHITECTURAL DRAWING course.  

 

Also I have revised by scripts and they are below. 

 

A word of caution they use a different record.  I revised the record to be "Status and Phase" to be more inline with the way others were using the terminology.  I also added records for demolition and new construction notes.   I would recommend not converting to the new format on an existing drawing because the new scripts do not work with the older data visualizations that I provided in the first files.  But if you do want to I have written another script to convert a drawing using the old script to the new scripts.  script =  "Convert to new Status and Phase record script from old Record" 

 

  You have to import the "Status and Phase" record into the old drawing before running the conversion script.  It will convert everything with out selection.   All of my Python Scripts may be freely distributed. No warranty provided. Use at your own risk.  (Download newest versions below)

 

Once you replace the scripts in you plugin folder the old record format will not work. 

image.thumb.png.6fc664c185dddfa17cc9768927812bad.png

 

Adding notes to the record you can use data tags to show the notes

image.thumb.png.6877e21cdbbef486a29a25d56b4ce5ef.png

 

 

 

Edited by The Hamma
  • Like 1
Link to comment

@The Hamma Great - Thank you for your recommendation. I'll watch the course.

 

So far I haven't any existing drawings to convert...

I'll study your scripts as you provided them.

 

It should be possible for me changing the colors of Data Visualization of your template.

In Swiss renovation projects colors are: 

red for new construction

yellow for demolition

black for existing to remain. 

 

 

Bildschirmfoto 2021-03-05 um 15.28.06.png

Link to comment

@The Hamma

Hello

I've started the RENDERING FOR EVERYDAY ARCHITECTURAL DRAWING course.

It's very interesting for me. Thanks again.

 

I've already noticed one particular thing concerning walls and their behavior in floor and section.

As Wes Gardner explains walls consist of a Container Class and of Component classes.

In floor plans it is possible to turn off the Component class, to show only outlines.

We can even change the filling of the containerr class from solid white to solid black in wall attributes.

 

If I try to do the same in section - say I turn of the component class of walls - 

the walls will completely disappear...

Isn't there a way to make section work the same way as floor plans?

 

 

 

 

 

Link to comment

hi. During research I've found the this thread...

Started playing around with the "test File".

Wouldn't it be possible to use the new 2021 Materials for renovation projects?

Say we have one Material for each phase:

Existing / Demolish / New

By overriding the fill attributes of Materials in Data Visualization,

we get the same result in Floor and Section...

Am I right?

Bildschirmfoto 2021-03-23 um 11.17.49.png

Bildschirmfoto 2021-03-23 um 11.19.09.png

Bildschirmfoto 2021-03-23 um 11.21.03.png

Link to comment

I think I've missed one thing:

It is necessary to combine Status/Phase database with the Materials.

I don't see the solution yet...

P.S.: I've noticed that you are using scripts for the phasing. 

I don't know scripting. I did use data base instead.

See attached image...

Either way, there should be a way to get the proper presentation for renovation plans in section.

 

Bildschirmfoto 2021-03-23 um 14.22.59.png

Bildschirmfoto 2021-03-23 um 14.26.55.png

Edited by Mi&D
Link to comment

@Pat Stanford & 

@The Hamma

 

Hi

I'm still struggling with Data Visualization for renovation.

At the moment I'm trying it with multiple Data visualization.

I managed to override "data base - entries" in floor plans,

and "2021 materials" in section. This gives me a better result.

But still there are issues with doors and windows. They do not take over the colors of corresponding walls.

As you see in the attachment the wing of doors are black, while the door case has the override-color of the wall...

There is also a problem with windows in floor plan: Some are "covered" by the solid fill of the wall,

while others appear correctly. For better understanding I attach the file.

 

Could I ask you for help to solve the problem with doors and windoows?

 

Also, I feel like in VW 2021 help, there isn't much explanation 

about multiple Data visualization...

Is there any tutorial about this topic?

 

 

 

kind regards

Michael

Multiple Data visualization_Renovation.vwx

Link to comment

Hi
What works for the doors doesn't work the same for windows.
I tried the same procedure on Windows but there is no result.

See Appendix...(*.jpg and *.vwx)

Even though the window in the red wall has the same class as the door, its color does not change.
There is also a difference in reveals between windows and doors.

I couldn't find any solution yet...

Could I ask you, if you have any idea on how to change window settings through data visualization?

 


297297877_Bildschirmfoto2021-03-26um09_00_14.thumb.png.eb07ce82925030fded33d39a2b0d5283.png

Multiple Data visualization_Renovation windows.vwx

Link to comment

This is what I get when I open the document.  

Try closing and reopening the document. or restarting vectorworks or your computer 

 

Also about the reveals. The door appears to have some sort of header.  It won't let me edit your door object. 

 

98421863_ScreenShot2021-03-26at8_32_40AM.thumb.png.4058986e7a55f6185497d3f196b9a82e.png

Edited by The Hamma
Link to comment

Hi

As far as I remember, the window tool in your version (I guess it's the version of the US) is different from the Swiss one.

This might be the reason why it isn't possible to edit those objects.

See this link from our Swiss Forum...

Down below I translated the essence for you...

 

Anyways, I need to understand how the attributes of windows work,

only then I can try to change them with data visualization.

But please, if you could try in your VW version, to insert a window 

in a wall and see what it gives after applying data visualization, 

the same way you did with the doors before (Doors Demo).

I should be really thankful for this.

 

 

3 hours ago, The Hamma said:

The door appears to have some sort of header.

The highlighted object on the printscreen you've sent me is not a door, but a window.

The header show levels of parapet and lintel.

 

Here now the translation of the thread:

Das Fenstertool ist beispielsweise wie @zoom schon aufführt komplett anders. (Das engl. Window Tool ist auch in der DE Version enthalten.)

For example, the window tool is completely different, as @zoom already performs. (The English Window Tool is also included in the DE version.)

 

D-A-CH Fenster:

Germany, Austria, Switzerland Window:

1931980554_FensterwerkzeugAllgemein.thumb.png.bb253cb8cddc9984aa1d3110c8a1b394.thumb.png.9efa1b127686603107f94e40eac6e6a6.png

1552917533_FensterDetaileinstellung.thumb.png.83a84b9af3faf06438769e12b3b527c5.thumb.png.8ec64d983e5fe1059bcc0dce0f459896.png

 

 

US Fenster:

US Window:

2048153791_FensterUS.thumb.png.bfdaa193b2e83d62cf8d7a0f0f9d4420.thumb.png.169c27b7feef6afb21e3163b58171b5c.png

 

Ich kenne die US Version zwar viel zu wenig, aber gefühlt ist die DE Version schon weit umfangreicher, vor allem was Anschläge, Leibungsausbildung, Fenstereinteilungen und auch die Plandarstellung angeht.

I know the US version far too little, but it seems like the Swiss version is more extensive, especially in terms of hinges, reveals, window layouts.

 

Es gibt auch noch die Benelux Version 😏, die kann dann noch viel mehr bei den Fensterformen (Freiformen).

There is also the Benelux version 😏, which can then do much more with the window shapes (freeforming).

 

Edited by Mi&D
Link to comment
  • 10 months later...
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...