modify the custom L1 of an object using VB.Net

modify the custom L1 of an object using VB.Net

Ender157
Contributor Contributor
342 Views
5 Replies
Message 1 of 6

modify the custom L1 of an object using VB.Net

Ender157
Contributor
Contributor

when running custom python Tray the user complains about the way the length is changed.

I can get/set ALL the properties off the object but the parameters are not listed i.e. L1.

I can read the parameters but not seem to set them. any thoughts?

 

Using tr As Transaction = doc.TransactionManager.StartOpenCloseTransaction()
Dim Partx As Entity = tr.GetObject(res.ObjectId, OpenMode.ForWrite)
Dim Param As New ParametricPart(Partx)
Dim Params() As String = Split(Param.Parameters.ToString, ",")
Dim Parinfo As ACPUtils.ParameterList = Param.Parameters
Dim Info1 As ACPUtils.ParameterInfo = Parinfo.Item("L1")

 

Info1.Value = NLen 'input from user 2 points

 

0 Likes
Accepted solutions (1)
343 Views
5 Replies
Replies (5)
Message 2 of 6

jabowabo
Mentor
Mentor
Accepted solution
Info1.Value = <your new value>
Param.UpdateEntity(partId, Parinfo)
0 Likes
Message 3 of 6

Ender157
Contributor
Contributor

you are AWESOME, that worked.

0 Likes
Message 4 of 6

Ender157
Contributor
Contributor
one more question if you please, this worked in my existing model. all new tray i place it gives me an error "ObjectdoesNotHaveLink" thoughts?
0 Likes
Message 5 of 6

jabowabo
Mentor
Mentor

@Ender157 wrote:
one more question if you please, this worked in my existing model. all new tray i place it gives me an error "ObjectdoesNotHaveLink" thoughts?

This message usually means the selected items are not Plant 3D objects, have lost database connection, or the drawing is not opened in the correct project context. Do the trays with the error show Plant 3D properties in the property palette? Also, do they have the 'L1' parameter name?

0 Likes
Message 6 of 6

Ender157
Contributor
Contributor
yes it is the same part i was dealing with, but i fixed the issue thanks.
0 Likes