Legacy Ideas are now read-only and have been migrated to our new platform: Aha! Click Here

New

[Place cell] "Rotate and Scale" interactive method missing

There is interactive method to "Scale and Rotate" cell before placement but there is no method  to  "Rotate and Scale" a cell.

For example if using MS for drawing floor plans and have doors,windows as cells. Then if there is wall with which is not orthogonal and I would like to place door cell in correct rotation and scale, then there is need for "Rotate and Scale" option. An extra option could be added  as "Scale and Rotate".

  • Have you ever used this option?
    In XM the wording was wrong so method was step 1 - scale cell and step 2 - rotate cell but name of the option was "Rotate and Scale" which was misleading as it didn't work that way. It was "fixed" in Bentley fashion instead of just adding another option "Scale and Rotate" it was simply renamed.

  • Not sure I understand the difference between “Scale and Rotate” and “Rotate and Scale”. DI like those XM options. We can bring that back. 
    samir 

  • A ticket was created to help finish the last part about changing the scale.

  • If this is not yet working macro then please ask in programming forum - https://communities.bentley.com/products/programming/microstation_programming/

  • I have been asking for help from developer support to write the same type of VBA macro.  We have a basic *.bas macro that has been used for years in uStn that based on the symbol/cell is placed at the current drawing scale, e.g. 1/4" to 1' 0"(48), 20' 0" to 1'(240)..... OR is placed 1 to 1.  To create/rewrite the macro in VBA has been a challenge.

    I have a working frame work thanks to Arthur in the Developer Network.  I am still working some issues with rotate portion when using the place cell icon key-in.  It seems that until you "manually" adjust the settings in the dialog does the macro start working correctly the VBA code seem to have NO EFFECT on the dialog box settings.  The macro started as a recorded macro with the following lines setting the options:

        CadInputQueue.SendCommand "PLACE CELL ICON"
             'SetCExpressionValue "tcb->activeCell", "<CellName>", ""  ' AC= is set by using the ActiveSettings.CellName
             SetCExpressionValue "tcb->ext_locks.trueScaleCells", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.relative", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.mirror", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.interactive", 1, ""   'set interactive
             SetCExpressionValue "tcb->msToolSettings.placeCell.interactionType", 1, ""  'Rotate only
             SetCExpressionValue "tcb->mlineFlags.scaleOffsets", 0, ""
             SetCExpressionValue "tcb->transformFlags.ignoreScaleForDimValues", 1, ""
             SetCExpressionValue "tcb->transformFlags.ignoreScaleForAnnotations", 1, ""

    Is there some type of method/property that can replace the " tcb> msToolSetting " section OR a different way to write it VBA??

    Sub PlaceCell()
        'On Error Resume Next
        
        Dim myCIQ As CadInputQueue
        Dim myCIM As CadInputMessage
        Dim point As Point3d  'user data point
        Dim cmdArgs() As String  'scale & cell name
        Dim activeCell As String 'cell name
        
        cmdArgs = Split(KeyinArguments, " ")
                Debug.Print cmdArgs(0)  'cmdargs(0) should hold "S" for scale or "N" not to scale
                Debug.Print cmdArgs(1)  'cmdargs(1) should hold cellname
        
        If UBound(cmdArgs) < 1 Then
            MsgBox "not enough parameter - exit", vbCritical
            Exit Sub
        End If
        
        Dim pAS As Point3d   'active scale
        pAS = ActiveSettings.Scale
        
        If cmdArgs(0) = "N" Then
            Dim ptScale As Point3d
            ptScale = Point3dFromXYZ(1#, 1#, 1#)
            ActiveSettings.Scale.X = 1
            ActiveSettings.Scale.Y = 1
            ActiveSettings.Scale.Z = 1
        End If
        
        Debug.Print "Scale X ", ptScale.X
        Debug.Print "Scale Y ", ptScale.Y
        
        ActiveSettings.CellName = cmdArgs(1)
        activeCell = cmdArgs(1)
        CommandState.StartDynamics
        
        If cmdArgs(1) = "LL*" Then
              CadInputQueue.SendKeyin "snap intersection"
        Else
              CadInputQueue.SendKeyin "snap nearest"
        End If
        
        'CadInputQueue.SendKeyin "place cell icon"
        CadInputQueue.SendCommand "PLACE CELL ICON"
             'SetCExpressionValue "tcb->activeCell", "<CellName>", ""
             SetCExpressionValue "tcb->ext_locks.trueScaleCells", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.relative", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.mirror", 0, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.interactive", 1, ""
             SetCExpressionValue "tcb->msToolSettings.placeCell.interactionType", 1, ""  ' Rotate only
             SetCExpressionValue "tcb->mlineFlags.scaleOffsets", 0, ""
             SetCExpressionValue "tcb->transformFlags.ignoreScaleForDimValues", 1, ""
             SetCExpressionValue "tcb->transformFlags.ignoreScaleForAnnotations", 1, ""
        
        
        ShowPrompt "Insertion point (or reset)"
        Set myCIM = CadInputQueue.GetInput(msdCadInputTypeDataPoint, msdCadInputTypeReset)
        Select Case myCIM.InputType
        
            Case msdCadInputTypeReset
                CommandState.StartDefaultCommand
            
            Case msdCadInputTypeDataPoint
                CadInputQueue.SendDataPoint myCIM.point
                        Debug.Print "X= " & point.X
                        Debug.Print "Y= " & point.Y
        End Select
        
        'Resets the scale of the drawing back to original scale
        ActiveSettings.Scale.X = pAS.X
        ActiveSettings.Scale.Y = pAS.Y
        ActiveSettings.Scale.Z = pAS.Z
        CommandState.StartDefaultCommand
    End Sub
    

    In the attached text file the macro relies on 2 inputs from the command line.  A number of custom tool pallets with the symbols on buttons for the user.  The command line in the button vba run [vbatext]pcell S PRD

    Steven W.