Remove parameter from User Parameters after adding to Custom Parameter Group

DRoam
Mentor Mentor
1,780 Views
10 Replies
Message 1 of 11

Remove parameter from User Parameters after adding to Custom Parameter Group

DRoam
Mentor
Mentor

I've just learned how to create a custom parameter group and add a parameter to it. However, the parameter remains in the User Parameters group. Is it possible to remove it from there so it's only shown in my custom group?

 

 

Accepted solutions (2)
1,781 Views
10 Replies
Replies (10)
Message 2 of 11

Pratik.Ksoni
Advocate
Advocate

You can right click on User parameter and delete it.

See attached file can help you.

 

Thanks

Pratik

0 Likes
Message 3 of 11

CCarreiras
Mentor
Mentor

@Pratik.Ksoni, i think DRoam is trying to do that with programing code.
I believe a mentor (rank10) of this forum knows how to delete a parameter... 

CCarreiras

EESignature

Message 4 of 11

DRoam
Mentor
Mentor

Deleting the parameter deletes the parameter entirely (including from my custom group). I don't want to delete it, I just want to remove it from the User Parameters group so it's only shown in my custom group.

 

Example:

Remove from User Parameters group.png

0 Likes
Message 5 of 11

JaneFan
Autodesk
Autodesk
Accepted solution

Hey @DRoam

 

There is no options when adding parameters into custom group to do so in API, so that the parameter need reside in both the original folder and the custom parameter folder now. 




Jane Fan
Inventor QA Engineer
Message 6 of 11

dgreatice
Collaborator
Collaborator

Hi, 

 

Note: You cant delete/remove original parameter.

Try this:

Dim oApp As Application
Dim oPD As PartDocument
Dim oPCD As PartComponentDefinition
Dim oPs As Parameters
Dim oUps As UserParameters
Dim oUP As UserParameter
Dim MyGroupParam As CustomParameterGroup
Dim MyParamList As New ArrayList

oApp = ThisApplication
oPD = oApp.ActiveDocument
oPCD = oPD.ComponentDefinition
oPs = oPCD.Parameters
oUps = oPs.UserParameters

InputField:
MyGroups = InputBox("Enter Name of Groups", "Enter Field")
Try
	MyGroupParam = oPs.CustomParameterGroups.Add(MyGroups, MyGroups)
	GoTo AddParameters
Catch
	MsgBox("Group Parameter Already Exist, Please Create Another Name", msgboxstyle.Critical, "Error")
	GoTo InputField
End Try

AddParameters :
For Each oUP In oUps
	MyParamList.Add(oUP.Name)
Next

MySelectedParam = InputListBox("Select Parameters", MyParamList)

For Each oUP In oUps
	If oUP.name = MySelectedParam Then
		MyGroupParam.Add(oUP)
	End If
Next

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 7 of 11

DRoam
Mentor
Mentor
Accepted solution

@JaneFan thank you for confirming for me.

 

For anyone who would like to vote, I created a request for this here: API: Put parameter in custom parameter group only (remove from User Parameters).

Message 8 of 11

Anonymous
Not applicable

There must have been a way of doing this in the past.

 

Untitled.png

0 Likes
Message 9 of 11

Anonymous
Not applicable

Oops, just realized, how I accomplished this before. It was not custom parameters, but object parameters.

Sorry

/Michael

 

 

 

0 Likes
Message 10 of 11

hamed_nemati
Participant
Participant

How can you create custom paremeters group?

0 Likes
Message 11 of 11

WCrihfield
Mentor
Mentor
0 Likes