# Copyright 2014 (c) Pointwise, Inc. # All rights reserved. # # This sample script is not supported by Pointwise, Inc. # It is provided freely for demonstration purposes only. # SEE THE WARRANTY DISCLAIMER AT THE BOTTOM OF THIS FILE. ## Header, required to load Glyph commands package require PWI_Glyph 2 ## Create selection mask to select only connectors ## Note: '\' character continues command to next line set mask [pw::Display createSelectionMask \ -requireConnector {}] ## Prompt user to select a single connector to project set pickedCon [pw::Display selectEntities -description \ "Select connector" -selectionmask $mask -single \ curSelection] ## Set variable $con to the current selection ## Note: No error handling; we have allowed only one ## selected connector with -single flag in the ## selectEntities command set con $curSelection(Connectors) ## Get the initial distribution ## Note that the 1 refers to the segment number ## (Script only works for connectors with one segment) set conDistribution [$con getDistribution 1] ## Get the spacinging from the initial distribution set spaceBegin [$conDistribution getBeginSpacing] set spaceEnd [$conDistribution getEndSpacing] ## Store the values of the intial spacing constraints ## at the begining and end set beginValue [$spaceBegin getValue] set endValue [$spaceEnd getValue] ## Begin Modify mode ## This prevents updates to remainder of grid until the ## mode is ended, improving performance set modifyMode [pw::Application begin Modify [list $con]] ## Project the connector pw::Entity project -type ClosestPoint $con ## Reset distribution to Tanh $con replaceDistribution 1 [pw::DistributionTanh create] ## Reset spacing constraints to original value set newDistribution [$con getDistribution 1] $newDistribution setBeginSpacing $beginValue $newDistribution setEndSpacing $endValue ## End Modify mode and update grid $modifyMode end # DISCLAIMER: # TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, POINTWISE DISCLAIMS # ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED # TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE, WITH REGARD TO THIS SCRIPT. TO THE MAXIMUM EXTENT PERMITTED # BY APPLICABLE LAW, IN NO EVENT SHALL POINTWISE BE LIABLE TO ANY PARTY # FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES # WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF # BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE # USE OF OR INABILITY TO USE THIS SCRIPT EVEN IF POINTWISE HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE # FAULT OR NEGLIGENCE OF POINTWISE.