Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
358 Views, 6 Replies

iLogic

Hi iLogic Users

 

I have a question about iLogic, I have been using this code for turning on/off solids in a part. this has been working fine until I reinstalled FDS. 

maybe  you can help. 

 

Is there something wrong with this code??

 

SyntaxEditor Code Snippet

Dim oCompDef as ComponentDefinition=ThisDoc.Document.ComponentDefinition
For Each oBody As SurfaceBody In oCompDef.SurfaceBodies

 Another thing.

 

Has any of you found a way to turn of a feature occurence in a pattern in a part ?

 

Br. Pia 

SašoPrijatelj
in reply to: Anonymous

The code you posted does nothing. It's only the beginning of the code. Did you make a mistake when copy-pasting or is that actual code you try to use?

-----------------------------------------------------------------------
AutoDXF - automatic flat pattern creation and batch export to DXF for Inventor

Please use "Accept as Solution" & give "Kudos" if this response helped you.
Anonymous
in reply to: SašoPrijatelj

Hi

 

Yes it´s the beginning of the code after that it could be like this.

 

If TheCodeAreRight then

If oBody.Name="Solid1"then oBody.Visible=1

Else

 If oBody.Name="Solid1"then oBody.Visible=0

End if

 

Next

 

Hope this make more sense :slightly_smiling_face:

 

- Pia  

SašoPrijatelj
in reply to: Anonymous

Hi,

 

Try this - it will make Solid2 invisible and Solid1 visible:

 

Dim oCompDef As ComponentDefinition = ThisDoc.Document.ComponentDefinition
For Each oBody As SurfaceBody In oCompDef.SurfaceBodies
	'If TheCodeAreRight Then
	If oBody.Name = "Solid1" Then 
		oBody.Visible=1
	Else If oBody.Name = "Solid2" Then 
		oBody.Visible=0
	End If 
Next
-----------------------------------------------------------------------
AutoDXF - automatic flat pattern creation and batch export to DXF for Inventor

Please use "Accept as Solution" & give "Kudos" if this response helped you.
Anonymous
in reply to: SašoPrijatelj

what´s the difference between the code you posted and the one that I posted ?

 

And why, does it suddenly not work anymore. ?

 

Br- Pia

SašoPrijatelj
in reply to: Anonymous

Even is structure of your code was correct (it's missing one EndIf) it would do nothing because in first IF statement you turn off SOLID1 and in second IF you turn on the same SOLID1.

 

 

-----------------------------------------------------------------------
AutoDXF - automatic flat pattern creation and batch export to DXF for Inventor

Please use "Accept as Solution" & give "Kudos" if this response helped you.
Anonymous
in reply to: SašoPrijatelj

Okey Sounds plausible.

 

What about this ?

 

If Code="On"then

if obody.name="Solid1"then oBody.Visible=1

else if Code="Off"then

If oBody.name="Solid1"then Obody.Visible=0

End if

 

Next

 

Still confused about, why it worked before reinstalling FDS2016?

 

-Pia