Jump to content
Developer Wiki and Function Reference Links ×

Needed: Adding the name of Hanging Position to Truss contained within.


SCParker

Recommended Posts

Hello All,

I'm looking for a script that will take the name of a hanging position and apply the name to one of the user fields of the truss record record attached to each section of truss contained within the hanging position object. I haven't explored scripting but I imagine it would look like: If Hanging Position has a name, insert same to truss record user field #1.

At the moment, I need to open each hanging position object and copy/paste the "Position Name" into the User Field. This is both time consuming and a hassle when wanting to change the HP name.

I want this to aid in making better worksheet reports. Having my lists of the truss assigned to various hanging positions aids in everything from truck packs to on site logistics.

The script would need to assign the names at anytime to allow HP name changing.

 

Thanks, Scott

2019-02-22_07-45-59.png

Link to comment

Assuming the hanging positions all use embedded geometry and not symbols (which would make assigning individual position names impossible), you need to get the Hanging Positions profile group, then iterate through items in the group. The Hanging Position would then need a reset for data to show up in worksheets. 

Link to comment

I have and am now working with the structure of hanging positions along with groups to create and improve my Truss Tag tool.  So... This would need to be a command, something like "Refresh Truss Posit Names", there is a 27 character limit on VS command names.  You would need to run it periodically because the Hanging Positions would not know to refresh the truss that make them up.  It would also require a dialog somewhere requesting the user field to use.  I'm willing to put such a command in the AutoPlot quiver , but I'm busy with the truss tag at the moment.  Feel free to bother me about it periodically, while you investigate your own solutions.  You would then harvest the "Truss" Record data in a worksheet?  This could get tricky.

I have a test file with 3 sticks of truss, 2 groups and a hanging position.

One group has 10 pieces

One group has 3 pieces

The Hanging Position has 3 pieces.

If I make a custom report based on the record "Truss Record" being present only 13 pieces are listed.  Obviously it is missing the 3 in the hanging position.

If I make a custom report based on the record "Truss Record" being present only 13 pieces are listed and I check include components of plug-in objects 32 pieces are listed.

There is only one layer.  All layers and classes or on(visible).  There are no other objects in the drawing except the ones I have listed.  Something is getting counted more than once.

If I make a report on the record "Truss" and include plug-in objects then the correct number of 16 objects is listed.  Unfortunately, there is no field available in which to place the Hanging position name

So, I delete all the objects in the drawing except the one hanging position that contains 3 pieces.  When I do a custom report 6 pieces get listed, 2 versions of each piece.  When I run my truss tag command, the tag polls through the objects in the profile group and lists the 3 pieces, correctly, and no more.  It doesn't matter if the pieces are grouped or not grouped, my truss tag polls appropriately.  However,... The custom report still lists 6 pieces

 

Strangely the "Truss" PIO is created by placing objects with the "Truss Record" attached.  Clearly I have an incomplete understanding of what the $%#@ is going on.  Any one with a better under standing?  It would be helpful to me and my truss tags and with creating the command that Scott desires.

Link to comment
31 minutes ago, SCParker said:

Well, wouldn't the truss symbols be symbols?

 

When you convert objects to a hanging position, you can base the position on a single symbol or embed geometry in the hanging position.  If you have a symbol that is, for example, a 40' batten, you can base your HP on the symbol.  Otherwise, you usually want to base the HP on embedded geometry (prior to VW 2014, symbol was the only option).  The Convert to Hanging Position buttons in the OIP don't even give the option of creating a symbol.

 

Whether the embedded geometry uses symbols is of no consequence to the script.  As long as the HP is embedded geometry (i.e. in the profile group) this should work.

 

34 minutes ago, Sam Jones said:

Strangely the "Truss" PIO is created by placing objects with the "Truss Record" attached.

 

The Truss PIO uses symbols with the Truss Record attached, an then also attaches a copy of that record to itself so the user can access it.  Thus each Truss object has two objects with the record attached: the symbol inside the PIO and the PIO itself.

 

If you want to create a report of objects with Truss Records, Including Components of Plug-in Objects will correctly look inside the Hanging Position.  If your positions are made of Truss Objects, you have to edit the criteria to list objects whose Record Truss Record is Present and Type is Parametric object.

 

Alternatively, you can do a report of objects of the type Truss and display data from the Truss Record.  If you are using a mixture of Truss Objects and regular truss symbols, the report can get complicated, but you're really better off using a consistent method to place truss anyway.

 

In terms of a script, that's actually a little simpler, as you can just not descend into objects that have the record attached (assuming you're manually iterating over objects and not using FEO).

Link to comment

Here's a copy of a file I've been playing with to help me better understand the truss counting and which report format works best for my needs. You'll see I have six sticks of truss and three clamps. Three of the truss sticks are inside a hanging position. My three worksheets all have the same report columns, but point to objects with different records. The one on the left (there's an image so we're all on the same page) counts all the truss accurately, both inside and outside the hanging position.

The two other worksheet suffer from either double counting or missing info. All depending on whether the report is counting the internal or second copy of the record. Oy.

WorksheetsForTrussCounting.vwx

Link to comment
  • Marionette Maven

Here's where I'm sitting right now. The Set Record Field node is reporting that it was successful, but the field in the record isn't being updated on trusses in the Hanging Positions.

I tried making duplicates of the trusses and putting them back into the hanging position without success, this is not shown in my file, (though when I do make copies and they appear on the Design Layer, the fields DO update appropriately) so it's really an issue of 'why can't I get this value to push to the object in this container?'

 

I asked some coworkers at the office today and didn't find anyone who could help immediately, but I'll try some more next week and see if someone else has some intel.

HPMarionette_MFarrell.vwx

Link to comment

@Marissa Farrell

I was curious if I could get this to work with Marionette.  The issue was that you were modifying the objects inside the Hanging Position PIO, but every time the PIO regenerates, these objects get deleted and recreated by the PIO script.  Instead, the network needs to modify the objects in the PIO's profile group.

 

I needed to create two custom nodes: Get Profile Group and Get Contained Objects, the latter iterating over the objets in a container and returning a list.  Also, the criteria at the start of the list needed to start with the Hanging Position and work in, rather than the contained objects, working out.

 

HPMarionette_MFarrell_JBenghiat.vwx

 

@SCParker

See if my explanation to Sam helps.  In your example, the worksheet that is doing what you want selects the Truss record, which is the record used to define the Truss PIO.  This selector would be identical to saying Type is Truss.  The correct report searches for all the Truss PIOs and then displays the Truss Record attached to them.

 

Searching for objects with Truss Record returns both the PIO and the symbols inside the PIO.

 

Your third worksheet searches for objects with the Truss Record that are NOT a Truss PIO, returning only the symbols inside the Truss objects

Edited by JBenghiat
Spelling
  • Like 1
Link to comment

The other way to do this automatically is with a worksheet script.  Add the following as a new Python Script resource:

vs.WSScript_SetResStr( vs.GetName( vs.GetParent( vs.GetParent( vs.WSScript_GetObject() ) ) ) )

Then use this formula where you want the HP name:

 

=RUNSCRIPT('SCRIPT_NAME')

 

where SCRIPT_NAME is whatever you called the resource.

Link to comment
  • 2 months later...

@scottparker

In your Resource Manager click New Resource, and select type Script. You may also have to create a new script palette. Keep track of what you name the script resource.

 

In the resulting Script Editor dialog, choose Python from the pull-down menu at the top. Copy and paste in the line of code above and exit the dialog.

 

In your worksheet, go to your header row, and select the column where you want the truss name to appear. Paste in:

=RUNSCRIPT('SCRIPT_NAME')

replacing SCRIPT_NAME with whatever you chose to name your script resource in the first step.

Link to comment

Scott,

I'm cruising the inside passage on a smaller vessel with limited internet, but you could use the AutoPlot "Place VLM Truss Tags" command.  You can delete the tags if they are no use to you, but they will leave the HP truss with a position field attached to the Truss Record and filled out with the HP name.

Josh pointed me in the right direction, but sorting out the multiple Truss Records had some trial and error involved in order to find the correct one to consistently use.

  • Love 1
Link to comment
  • 6 months later...
On 5/16/2019 at 7:14 PM, Sam Jones said:

Scott,

I'm cruising the inside passage on a smaller vessel with limited internet, but you could use the AutoPlot "Place VLM Truss Tags" command.  You can delete the tags if they are no use to you, but they will leave the HP truss with a position field attached to the Truss Record and filled out with the HP name.

Josh pointed me in the right direction, but sorting out the multiple Truss Records had some trial and error involved in order to find the correct one to consistently use.

 

Hey @Sam Jones I was trying out your Truss Tag workflow to get the position names in Truss within Hanging Positions. It looks great and is exactly what I was looking for for a long while!

 

I found one issue however. On the first cycle of the workwflow everything looks great, my worksheets shows the position values.

 

But then I want to edit the Hanging Positions Profile and add some extra Truss. If I now go through the steps again. The worksheet will not update the position in the newly added trusses. There is an extra line with the position field left empty. Then if I only enter and exit the edited HP again, then the position field updates again. Like it needs some kind of extra refresh. 

 

 

Link to comment

Hey Sam,

 

Used the Refresh all truss tags. It seems like the trusses within the HP do not update after re-entering and exiting the HP.   It was strange to me too, because the first cycle of the workflow works flawless. But after editing a HP the data does not update immediately. I’ll pm you a screenrecording if you want. 

 

30 minutes ago, Sam Jones said:

Sebastian, I'm finding it strange that entering and exiting the the HP refreshes the the Truss tag.  I don't have access to the code for HPs.  There is a "Refresh All Truss Tags" that should accomplish the refresh.

 

Link to comment

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...