PART GEOMETRY PARAMETERS TO MAKE READ ONLY

PART GEOMETRY PARAMETERS TO MAKE READ ONLY

ganesh_gCNKFB
Advocate Advocate
148 Views
5 Replies
Message 1 of 6

PART GEOMETRY PARAMETERS TO MAKE READ ONLY

ganesh_gCNKFB
Advocate
Advocate

Dear Forum experts,

 

is there any way to make some of the part geometry parameters in read only mode. (Should not be editable through property tab). Only selected parameters shall be edited.

Kindly refer below snap for One of the Pipe Support.

 

ganesh_gCNKFB_1-1759995951659.png

In above snap only SH parameter shall be editable & rest others need to be in read only mode.

 

Kindly guide whether this can be done through Project setting or through Python script.

 

Thanks

 

0 Likes
149 Views
5 Replies
Replies (5)
Message 2 of 6

matt.worland
Advisor
Advisor

The easiest way is you dont add them as parameters, keep them internal to your ptyhon file. You can just remove the @params and then move them out of your initilize parameters of your def.

@activate(Group="Support", Ports="1", TooltipShort="your support", TooltipLong="your support", LengthUnit="mm")
@group("MainDimensions")
@param(OD=LENGTH, TooltipShort="Pipe dia")

def YOURSUPPORT(s, OD=120.0, **kw):
   A=80.0
   A1=100.0
   Angle=5.0
   L1=8.0
   SH=1000.0
   Stretch_Ratio=500.0
   T2=1
   T3=150.0
   max_H=200.0
   min_H=12.0

 Instead of hard-coding them, add logic code in your Python script; you could pull them from an external file or another Python file.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 3 of 6

shreya_valte
Participant
Participant

Can we do this in plant3D environment itself because if we are declaring variables in the script, parameters in properties will not be visible. 

 

Message 4 of 6

ganesh_gCNKFB
Advocate
Advocate

Dear Sir, @matt.worland 

 

Thank you for attention to this topic.

 

We need to keep all parameters visible in Property window but some of the parameters need to make read only.

 

Is there any setting in plant 3d Set up or can we lock them in Python scripts. or any .NET solution?

 

0 Likes
Message 5 of 6

jabowabo
Mentor
Mentor

@ganesh_gCNKFB wrote:

We need to keep all parameters visible in Property window but some of the parameters need to make read only.

 

Is there any setting in plant 3d Set up or can we lock them in Python scripts. or any .NET solution?

 


In short, all parameter values are read/write with no way to modify that. You could potentially override any changes with a .NET plugin, but that would only work for users that are running the plugin.

Message 6 of 6

matt.worland
Advisor
Advisor

I'm not aware of any settings for this. As @jabowabo mentions, if the property is visible, then its read/write. 

 

Beyond the API, I don't know of a way to make it read only. You could try adding logic in your python, but I'm not sure how you would accomplish that.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"