cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

VB API Help with renaming

JoeVarghese
1-Newbie

VB API Help with renaming

Hi All, Is there anyone using VB API. I have a UDF Feature. I want to change the Group name. 'Code Start Dim featGrup As IpfcFeatureGroup .... msgbox ("Group Name : " + featGrup.GroupName) 'Code End I am able to get the GroupName. But its a readonly property. Cant change the name using that. I also tried to cast this to IpfcFeature. But that also seems not working. Can anyone help, either with this prob or How to Rename an ordinary feature? Thanks. HTH, Joe. ---------------------------------------------- you can find some tips at... http://tipsfromjoe.blogspot.com ----------------------------------------------
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

Joe Havent tried to rename a UDF but i have been working on updating some 3D Notes lately and it should probably be the same approach. Dim model As IpfcModel model = asyncConnection.Session.CurrentModel Dim powner As IpfcModelItemOwner powner = model Dim item As IpfcModelItem item = powner.GetItemByName(9, "Note_1") ' Here i use the SetName property on the 3D Note to change its name. item.SetName("MYNAME") ' Hope that helps

Thanks Hugo. I will check it tomorrow and let you know. Thanks for the time and help. Regards Joe ---------------------------------------------- you can find some tips at... http://tipsfromjoe.blogspot.com ----------------------------------------------

Thanks Hugo. I have used your logic and is working fine. 'Code start .............. Dim featGrup As IpfcFeatureGroup 'Cust function to create UDF and return the object featGrup = cust_CreateNodeUDFInPart(objName, featName, dia) 'Check if its created If featGrup Is Nothing Then MsgBox("Error creating UDF") Return Nothing End If 'For RENAMING THE GROUP. Dim pOwner As IpfcModelItemOwner pOwner = model Dim item As IpfcModelItem item = pOwner.GetItemByName(EpfcModelItemType.EpfcITEM_FEATURE, featGrup.GroupName) If item Is Nothing Then MsgBox("Cant assign to ITEM") Return Nothing Else item.SetName("NODE_WIREDIA") End If 'code END. I have only a small issue now. The renaming is not visible at the first instance. I need to find the code refresh the Model Tree. But thats ok. Thanks Hugo again. Regards Joe Varghese ---------------------------------------------- you can find some tips at... http://tipsfromjoe.blogspot.com ----------------------------------------------
Top Tags