Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python isVisible on ValueInput affects "name" (prompt) but not the control

1 REPLY 1
SOLVED
Reply
Message 1 of 2
tim.collins29V9X
134 Views, 1 Reply

Python isVisible on ValueInput affects "name" (prompt) but not the control

I toggle isVisible on a NameValue in response to a checkbox to make the NameValue disapper or re-appear (I can't detect a disable feature in the ref doc nor in the limited API I can see) but only the prompt (termed "name" in the API) will appear and disappear.

Is this a bug?

Is there a problem with keeping and later referring to the control returned from xxx.addValueInput()?  Was I supposed to use xxx.inputs.itemById()?  The reason I ask is that I did try comparing the control with the one I saved for "equilateral" and it did not work, so I resorted to an "id" compare instead. Is there something going on with all the calls to .cast() and such?  Is is just me or is the documentation more than simply terse?

   def notifyInputChanged(self, inputChangedEvent: InputChangedEventArgs):
        """
        The super().notifyInputChanged() method will update the model object. Add code here before or after
        if needed to provide any required computation or error checking.
        """
        super().notifyInputChanged(inputChangedEvent)

        if inputChangedEvent.input.id == self.equilateralInput.id:
            self.heightInput.isVisible = not self.equilateralInput.value

 

1 REPLY 1
Message 2 of 2

I hate it when this happens, but the entire widget will now appear and disappear properly, not just the name. I have no idea why, but I no longer reproduce my own issue.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report