Rotate shape.Line to 45 degree

  • Dear Team,

    I am doing some logic code for simulating electrical circuit.

    For that i draw the circuit using line. I want to rotate the line position to 30 or 45 degree. so that it will display as the switch is tripped.

    For example if i press MCB_OFF button, the line "RedClr3" should rotate to 30 degree. And again if i press MCB_ON button, the line "RedClr3" should be normal 0 degree.

    I dont know how to do this shape rotation.

    Can any one help me for this. I am attaching my file here for your reference.

  • Or with a single button.

    If you use a shape, like a rounded rectangle for instance, you can change the background color from green to red and vv also.

  • Dear jolivanes,

    I had applied single button code.

    My question is how to apply the below condition on this single button condition.

    And is it possible to change colors gradually like it is flow from one end to other end.

    can you explain me.

  • And also how to do the following condition

    I am getting error on following lines

    1. If ActiveSheet.Buttons(Application.Caller).Caption = "ON" Then ' MCB Button ON Condition
    2. &
    3. If ActiveSheet.Buttons(Application.Caller).Caption = "ON" Then ' MCB Button & SKIP Button ON Condition
    4. &
    5. If ActiveSheet.Buttons(Application.Caller).Caption = "ON" Then ' MCB Button & SKIP Button ON Condition
  • Dear jolivanes,

    I had modified your code as per my requirement. But i was struck in some where.

    created button for MCCB_ON_OFF

    My condition is When UVC is green in color and if i press MCCB ON that time ("RedClr16", "YellowClr2", "BlueClr2", "Neutral7") become 0 degree and all ("Neutral8", "Neutral9", "RedClr17", "RedClr18", "YellowClr3", "YellowClr4", "BlueClr3", "BlueClr4") line colors to be change red, yellow & blue.

    if i pressed MCCB OFF or UVC changed to red color ("RedClr16", "YellowClr2", "BlueClr2", "Neutral7") it should change to 45 degree .

    Can you please help me for this

  • I had modified code for change Line color when MCCB is ON or OFF.

    But this shoud ON or OFF with my condition.

  • I do not know what all these mean "MCCB_ON_OFF", "UVC", "MCCB_On"

    Express yourself so everybody understands.

    In the attachment from Post #6, the arrays are for each individual set of lines, color or increment rotation.

    Have you done that?

    ("RedClr16", "YellowClr2", "BlueClr2", "Neutral7")

    ("Neutral8", "Neutral9", "RedClr17", "RedClr18", "YellowClr3", "YellowClr4", "BlueClr3", "BlueClr4")

    ("RedClr16", "YellowClr2", "BlueClr2", "Neutral7")

    Looks to me that they are all bunched together.

    Familiarize yourself with what the code in that attachment does and then make your own code.

    It won't be done in five minutes. It will take a while but you better be prepared to spend some time on it.

    You will need to know how to make the code in order to be able to change/fix it at a later date.