Place content Center Bug

Place content Center Bug

mat_hijs
Collaborator Collaborator
539 Views
7 Replies
Message 1 of 8

Place content Center Bug

mat_hijs
Collaborator
Collaborator

I believe I'm facing a bug when placing or replacing content center parts using iLogic. Because of the size of my custom Content Center Library I can't share the zipped Pack & Go here on the forums but I'll try my best to explain the issue anyway.

 

So, like I said, I created a custom Content Center Library. I also created an external rule with classes to place certain categories or families into an assembly, in the zipped Pack & Go this is an internal rule but this doesn't change anything. This is the class I'm using:

Public Class Rubber
	Public Property Category As String = "Reynaers_Dichtingen"
	Public Property Name As String
	Public Property Number As String
	Public Property Length As Integer
	Public Property Visible As Boolean
	Public Property Components As IManagedComponents
	Public Property Component As ICadComponent
	
	Public Sub New(Components As IManagedComponents, Component As ICadComponent)
		Me.Components = Components
		Me.Component = Component
	End Sub
	
	Public Sub Place()
		Components.AddContentCenterPart(Name, Category, Number, {"Lengte", Length }, , False, , )
		Component.Visible(Name) = Visible
	End Sub
End Class

Then, in my assembly, I created an internal rule that uses this class to place or replace a Content Center part:

AddVbRule "SDK"
Sub Main
	' Place/Replace Content Center Member Rubber
	Dim oRubber As New Rubber(Components, Component)
	oRubber.Name = "Rubber"
	oRubber.Number = Nr_Rubber
	oRubber.Length = Lengte_Rubber
	oRubber.Visible = Rubber
	oRubber.Place
End Sub

Also in the assembly, I have a True/False parameter "Rubber", a multivalue Text parameter "Nr_Rubber" and a Numeric parameter "Lengte_Rubber" to set the visibility, the family name and the length of my Content Center part.

The class and the rule initially work like intended, placing and updating the Content Center part when changing the parameters.

However, when the visibility is set to False (and the component is correctly hidden) and I then change the parameter "Nr_Rubber" the part is suddenly visible even though it shouldn't be. The browser icon still indicates that it is invisible. When right clicking the component, Visibility is checked and can not be manually changed.

 

This doesn't seem right to me and is posing a great challenge in building my configurators.

Could you take a look at this @MjDeck ? I sent you the zipped Pack & Go via e-mail.

 

Thanks

0 Likes
540 Views
7 Replies
Replies (7)
Message 2 of 8

mat_hijs
Collaborator
Collaborator

I tried narrowing it down as much as possible and when simplifying the code to the bare minimum the effect is still the same:

Components.AddContentCenterPart("Rubber", "Reynaers_Dichtingen", Nr_Rubber, {"Lengte", Lengte_Rubber }, , False, Rubber, )

 

0 Likes
Message 3 of 8

Curtis_Waguespack
Consultant
Consultant

Hi @mat_hijs , It might be helpful to create a simplified version of your custom CC file with just a couple of rows, and load it here too.

EESignature

0 Likes
Message 4 of 8

mat_hijs
Collaborator
Collaborator

@Curtis_Waguespack Of course I should have done this to begin with... Anyway, here is the Pack & Go with just 2 families in the CC Library.

Message 5 of 8

MjDeck
Autodesk
Autodesk

Hi @mat_hijs - thanks for reporting this. I'm looking into it now. I can also reproduce it with parts from the standard Content Center libraries. The problem happens if you modify an existing component and change the value of the familyName argument.
As a workaround, you could add the line:

 

Components.Delete(Name)

 

at the top of your Place subroutine. This will make sure that the Add function gets a fresh start every time.
(The Delete function will not throw an error if the component does not exist.)


Mike Deck
Software Developer
Autodesk, Inc.

Message 6 of 8

mat_hijs
Collaborator
Collaborator

@MjDeck Thanks for looking into this, I also don't think this has always been there, but I'm not 100% sure.

Deleting the component before adding it again would be an option, but this means that I would need to constrain them programmatically too, which would be a pain in my case because it makes it more complex and I suspect it may impact the performance too because I'll be replacing a whole lot of components.

I'll need to do some proper testing when I get back to work but after a quick test at home making the component visible before replacing works. This doesn't work when placing it for the first time, but I'm sure I'll find a way around that.

 

Thanks and please keep me updated on the issue!

Message 7 of 8

MjDeck
Autodesk
Autodesk

You're right: making the component visible before doing the replacement operation is a better workaround. Here's code that just ignores an error when the component does not exist:

Try 
	Component.Visible(Name) = True	
Catch
End Try

Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 8

MjDeck
Autodesk
Autodesk

This is internal issue number INVGEN-77454.


Mike Deck
Software Developer
Autodesk, Inc.