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

Inventor idw to dxf vs ACAD dxf creation

JasonMayes
Advocate

Inventor idw to dxf vs ACAD dxf creation

JasonMayes
Advocate
Advocate

In the transition from ACAD to Inventor I stumbled into a snag from my previous predecessor. They created a lisp routine that when fired would prompt users a series of questions with the outcome of producing a dxf file with all bolt holes replaced with cross hairs for our vendors to burn only the profile and center punch the cross hair locations to be drilled by our drill department. I have attached a pdf of the pre process and post process of the ACAD routine as well as a dxf created in Inventor. Any suggestions on how to create the same type of dxf as the ACAD version? We are currently saving back into ACAD, changing to ACAD layers, and running the command from there. Not very streamlined. Any help would be greatly appreciated.

 

Thanks,

Jason Mayes

0 Likes
Reply
1,738 Views
21 Replies
Replies (21)

MechMachineMan
Advisor
Advisor

I would think you should just be able to write a macro in inventor that:

 

1) Makes a new/temporary copy of the flat pattern sheet in inventor that

2) Deletes all current centerlines

3) Calls auto-centerline without inferring patterns

4) Adds all of those centerlines to an etched line layer

5) Moves all circular sketch lines to their own layer and hide them.

6) Exports to dxf.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi Jason,

 

Could please post non confidential file samples (idw and dwg) for testing purpose?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

JasonMayes
Advocate
Advocate

Additional files as well as the program that creates our current dxf's in ACAD.

0 Likes

JasonMayes
Advocate
Advocate

any help @Curtis_Waguespack

maybe a macro (preferably with a button for the ribbon) or illogic?

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi Jason,

 

Please find a sample iLogic code in the following.

 

Sub Main()

	Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    Dim oSheet As Sheet
    oSheet = oDrawDoc.Sheets.Item(1)

    Dim obj As DrawingCurveSegment
    obj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select circle to create punch")

    obj.Visible = False

    Dim oCircleCurve As DrawingCurve

    For Each oCurve As DrawingCurve In oSheet.DrawingViews.Item(1).DrawingCurves
        If oCurve.CurveType = CurveTypeEnum.kCircleCurve Then
            For Each oSegment As DrawingCurveSegment In oCurve.Segments
                If oSegment.Equals(obj) = True Then
                    oCircleCurve = oCurve
                    oSegment.Visible = False
                    Exit For
                    Exit For
                End If
            Next
        End If
    Next

    Dim oIntent As GeometryIntent
    oIntent = oSheet.CreateGeometryIntent(oCircleCurve)

    Dim oCenter As Inventor.Centermark
    oCenter = oSheet.Centermarks.Add(oIntent)

    DXF_Export()

    obj.Visible = True

    oCenter.Delete()

End Sub

Private Sub DXF_Export()
    ' Get the DXF translator Add-In.
    Dim DXFAddIn As TranslatorAddIn
    DXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")

    'Set a reference to the active document (the document to be published).
    Dim oDocument As Document
    oDocument = ThisApplication.ActiveDocument

    Dim oContext As TranslationContext
    oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism

    ' Create a NameValueMap object
    Dim oOptions As NameValueMap
    oOptions = ThisApplication.TransientObjects.CreateNameValueMap

    ' Create a DataMedium object
    Dim oDataMedium As DataMedium
    oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

    ' Check whether the translator has 'SaveCopyAs' options
    If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then

        Dim strIniFile As String
        strIniFile = "C:\tempDXFOut.ini"

        ' Create the name-value that specifies the ini file to use.
        oOptions.Value("Export_Acad_IniFile") = strIniFile
    End If

    'Set the destination file name
    oDataMedium.FileName = ThisDoc.PathAndFileName(False) & ".dxf"

    'Publish document.
    Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

End Sub

 

On running the code, it asks for a circle to select. After successful selection, a center mark is created on that circle and export to dxf at same location and same file name.

 

This iLogic code can be extended for multiple selection. It is also can be extended automatic selection of circles which is having lesser radius(for example, 0.5 in radius).

 

Please feel free to contact if there is any doubt.

 

If solves your problem, click on "Accept as solution" or give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

JasonMayes
Advocate
Advocate

I was able to get your code to run but it wasn't what I expected. I will describe it better here.

 

When we run the rule or macro we want

 

1. All holes under 1 1/8" dia to marked with center marks and the hole disabled leaving only the center mark.

2. After the geometry and center marks are all that's left the file needs to exported "saved" into a network drive location as a 2004 dxf(or older) with the same name as the idw. We will use R:\email for our location of the dxf's 

 

**side note

 

We also save a copy of the idw as a dwf with all dimensions on it for our vendors to check quality of the parts. We have something in place for that now but it would be great if we could tie it all together.

 

thanks,

Jason Mayes

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi Jason,

 

VBA macro has been updated to achieve requirement.

 

 

Sub main()

    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument

    Dim oSheet As Sheet
    
    For Each oSheet In oDrawDoc.Sheets
        Dim oView As DrawingView
        For Each oView In oSheet.DrawingViews
            Call oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oView)
            Dim oCurve As DrawingCurve
            For Each oCurve In oView.DrawingCurves
                If oCurve.CurveType = CurveTypeEnum.kCircleCurve Then
                    Dim seg As DrawingCurveSegment
                    For Each seg In oCurve.Segments
                        If seg.Geometry.Radius <= 1.125 / 2 Then
                            Dim oIntent As GeometryIntent
                            Set oIntent = oSheet.CreateGeometryIntent(oCurve)

                            Call oSheet.Centermarks.Add(oIntent)

                            seg.Visible = False
                        End If
                    Next
                End If
            Next
        Next

        Dim oDataIO As DataIO
        Set oDataIO = oSheet.DataIO

        Call oDataIO.WriteDataToFile("DWF", "C:\Temp\dwfTest1.dwf")

    Next
    Call ExportDXF
End Sub

Sub ExportDXF()

' Get the DXF translator Add-In.
    Dim DXFAddIn As TranslatorAddIn
    Set DXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")

    'Set a reference to the active document (the document to be published).
    Dim oDocument As Document
    Set oDocument = ThisApplication.ActiveDocument

    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = kFileBrowseIOMechanism

    ' Create a NameValueMap object
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap

    ' Create a DataMedium object
    Dim oDataMedium As DataMedium
    Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

    ' Check whether the translator has 'SaveCopyAs' options
    If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then

        Dim strIniFile As String
        strIniFile = ".ini path\exportdxf.ini"

        ' Create the name-value that specifies the ini file to use.
        oOptions.Value("Export_Acad_IniFile") = strIniFile
    End If

    'Set the destination file name
    oDataMedium.FileName = "c:\temp\tempdxftest.dxf"
    
    'Publish document.
    Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

End Sub

 

In the above code, there are 3 important paths (highlighted in red color) that need to be updated as per the user requirement.

 

  1. Path of .dwf - This can be changed to required path (Network path)
  2. Path of .ini - exportdxf.ini is zipped and attached with this post. This is very important file and used to mention .dxf export format. Currently, it is mentioned as "AUTOCAD VERSION=AutoCAD 2004". Need to download, unzip and locate at desire location. The desire location should be mentioned in the above code.
  3. Path of .dxf - This can be changed to required path (Network path)

 

Please feel free to contact if there is any doubt.

 

If solve your problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

JasonMayes
Advocate
Advocate

Still not what I am looking for. I have a meeting with our vendors to see if the default "save copy as" to dxf from flat pattern will work for them. If so I will then be looking at creating a button to run that process. ant help on that would be greatly appreciated.

 

Thanks,

 

Jason

0 Likes

JasonMayes
Advocate
Advocate

After the meeting with our vender it was determined that a simple "save as dxf" from the ipt flat pattern was the best way to go. Any ideas on how to create a button for the ribbon would be greatly appreciated.

 

Thanks,

Jason

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi Jason,

 

An Add-In is created and attached with this post. On successful loading Add-In, Ribbon called "Save As Dxf" will be created on activating "Flat Pattern" mode as shown below.

 

Ribbon.JPG

 

 

Unzip attached SaveAsDxf.zip and locate the same at "%appdata%\Autodesk\ApplicationPlugins". After locating folder, "Autodesk.SaveAsDxf.Inventor.addin" and "SaveAsDxf.dll" files should available at "%appdata%\Autodesk\ApplicationPlugins\SaveAsDxf".

 

Initially, Add-In will be blocked. Go to "Tools" tab-> Click on "Add-Ins" button -> "Add-In Manager 2017" will be launched as shown below. In that, need to uncheck "Block" box and check "Load Automatically" and "Loaded/Unloaded" boxes.

 

Unblock.JPG

 

Source code is also attached with this post for further enhancement.

 

Note: If "ApplicationPlugins" is not available at "%appdata%\Autodesk\", folder need to be created.

 

Please feel free to contact if there is any doubt.

 

If solves your problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



cameron.houston
Enthusiast
Enthusiast

Hi,

 

I am interested in trying to implement this solution, however when I download and an unzip the file I cannot find the .dll file that is mentioned above, or any .dll file for that matter. Is there another file type I can use to get this add in to run?

 

Thanks,

 

Cameron

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

@cameron.houston,

 

Actually, the attachment contains only source code. To get dll, need to build the source code using Visual studio 2015.

 

Thanks ans regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

JasonMayes
Advocate
Advocate

Since my original post I have approached this at a different angle. In place of creating a dxf file of the idw we are currently creating dxf's from the part files. We do this 2 different ways (depending on who needs it). We have an assembly level iLogic rule that basically opens all parts and if there is a flat pattern then it exports the dxf to a network drive and names it the same as the part file name. The only issue that one has is if you have been in Inventor for a period of time then I am assuming the cache fills and causes Inventor to crash. Once the software is restarted it runs perfectly. Our internal dxfs are fine for our programmers. The other is a macro with a button on the ribbon that we fire when needed at the sheet metal part level. We typically use this method for vendor dxf files.

 

Our vendor has again requested a change and I cannot figure out how to do what they want. I am reaching out to the community for help. I will attach our current macro code which is fired by a custom button placed on the ribbon. I will also attach 2 dxf files, 1 from ACAD (the old way), and 1 from Inventor (the new way). The vendor has asked us to remove all internal circles (holes) and just leave the center point. They state that they have to open all dxfs and manually delete all this geometry prior to importing it into their CAM software. The way we capture this now in ACAD is a question is asked during the dxf creation via lisp what the largest hole dia to be drilled is. The routine then places a center mark on all holes with a diameter equal to or smaller that value. For simplicity this could be a static value of 1 1/8" dia. All help will be appreciated.

 

Jason Mayes

 

Sub VendorExportDXF()
'config
'Change values located here to change output.
Dim strPath As String
strPath = "R:\email\" 'Must end with a "\"
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2004" _
+ "&OuterProfileLayer=OUTER_PROF&OuterProfileLayerColor=255;165;0" _
+ "&InteriorProfilesLayer=INNER_PROFS&InteriorProfilesLayerColor=124;252;0" _
+ "&FeatureProfileLayer=FEATURE&FeatureProfileLayerColor=255;0;255" _
+ "&ArcCentersLayer=CENTERS&ArcCentersLayerColor=135;206;235" _
+ "&IV_Arc_Centers&InvisibleLayers=IV_Tangent;IV_Bend;IV_Bend_Down;IV_Bend_Up&IV_Arc_Centers&InvisibleLayersColor=135;206;235"

'/config
Dim oPartDoc As Document
Set oPartDoc = ThisApplication.ActiveDocument
Dim oFlatPattern As FlatPattern

'Pre-processing check:
' The Active document must be a Sheet metal Part with a flat pattern
If oPartDoc.DocumentType <> kPartDocumentObject Then
MsgBox "The Active document must be a 'Part'"
Exit Sub
Else
If oPartDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
MsgBox "The Active document must be a 'Sheet Metal Part'"
Exit Sub
Else
Set oFlatPattern = oPartDoc.ComponentDefinition.FlatPattern
If oFlatPattern Is Nothing Then
MsgBox "Please create the flat pattern"
Exit Sub
End If
End If
End If

'Processing:
Dim oDataIO As DataIO
Set oDataIO = oPartDoc.ComponentDefinition.DataIO
Dim strPartNum As String
strPartNum = oPartDoc.PropertySets("Design Tracking Properties").Item("Part Number").Value
Dim strRev As String
strRev = oPartDoc.PropertySets("Inventor Summary Information").Item("Revision Number").Value
Dim oDXFfileNAME As String
oDXFfileNAME = strPath & strPartNum & ".dxf"
Call oDataIO.WriteDataToFile(sOut, oDXFfileNAME)
MsgBox "DXF has been created in R:\email"
'Toggle this on/off to open output folder during output.
'Call Shell("explorer.exe" & " " & strPath, vbNormalFocus)
End Sub
0 Likes

cameron.houston
Enthusiast
Enthusiast

Hi Jason,

 

The " assembly level iLogic rule that basically opens all parts and if there is a flat pattern then it exports the dxf to a network drive and names it the same as the part file name" is essentially the exact workflow I am looking to achieve. Would it be possible for you to share the ILogic code for this? Is this a simple rule you have created?

 

Thanks,

 

Cameron

0 Likes

JasonMayes
Advocate
Advocate

this is the macro that fires the rule, it is added to our ribbon as a button

Public Sub AssemblyExportDXFs()

Dim addIn As ApplicationAddIn
Dim addIns As ApplicationAddIns
Set addIns = ThisApplication.ApplicationAddIns
    For Each addIn In addIns
        If InStr(addIn.DisplayName, "iLogic") > 0 Then
                        addIn.Activate
            Dim iLogicAuto As Object
            Set iLogicAuto = addIn.Automation
            Exit For
        End If
    Next
Debug.Print addIn.DisplayName
 
 
Dim RuleName1 As String
EXTERNALrule = "DXF-Flat Patterns Export to Burn" ‘this is where you will call out out your rule name, ours is an external rule

Dim RuleName2 As String
INTERNALrule = "Rule0"
 
  Dim oDoc As Document
 
  Set oDoc = ThisApplication.ActiveDocument
  If oDoc Is Nothing Then
    MsgBox "Missing Inventor Document"
    Exit Sub
  End If
 
'iLogicAuto.RunRule oDoc, INTERNALrule 'for internal rule
iLogicAuto.RunExternalRule oDoc, EXTERNALrule 'for external rule

End Sub

here is our external rule that is fired from above macro

'define the active document as an assembly file
Dim oAsmDoc As AssemblyDocument

oAsmDoc = ThisApplication.ActiveDocument

oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)



'check that the active document is an assembly file
If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then

	MessageBox.Show("Please run this rule from the assembly file.", "iLogic")
	
	Exit Sub
	
End If

'get user input
RUsure = MessageBox.Show ( _
"This will create a DXF file for all of the assembly components that was created using the sheet metal template." _
& vbLf & "This rule expects that the part file is saved." _
& vbLf & " " _
& vbLf & "Are you sure you want to create DXF for all of the assembly components?" _
& vbLf & "This could take a while.", "iLogic  - Batch Output DXFs ",MessageBoxButtons.YesNo)

If RUsure = vbNo Then

	Return
	
	Else
	
End If

oPath = "R:\email\Burn Table" 'this will need to be modified for your use

oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

oContext = ThisApplication.TransientObjects.CreateTranslationContext

oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism

oOptions = ThisApplication.TransientObjects.CreateNameValueMap

'get DXF target folder path
oFolder = oPath & "\" & oAsmName

'Check for the DXF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then

    System.IO.Directory.CreateDirectory(oFolder)
	
End If
'- - - - - - - - - - - - -

'- - - - - - - - - - - - -Component  - - - - - - - - - - - -
'look at the files referenced by the assembly
Dim oRefDocs As DocumentsEnumerator

oRefDocs = oAsmDoc.AllReferencedDocuments

Dim oRefDoc As Document


'work the drawing files for the referenced models
'this expects that the model has been saved
		For Each oRefDoc In oRefDocs
			
			iptPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) & "ipt"

    		'check that model is saved
			If(System.IO.File.Exists(iptPathName)) Then
			
                Dim oDrawDoc As PartDocument
				
                oDrawDoc = ThisApplication.Documents.Open(iptPathName, True)
				
            	oFileName = Left(oRefDoc.DisplayName, Len(oRefDoc.DisplayName))
				
				Try
				
                	'Set the DXF target file name
                	ofilename = Left(oRefDoc.displayname, Len(oRefDoc.DisplayName) - 3)
					
					oDataMedium.FileName = oFolder & "\" & oFileName & "dxf"
				
					Dim oCompDef As SheetMetalComponentDefinition
				
					oCompDef = oDrawDoc.ComponentDefinition
					
					If oCompDef.HasFlatPattern = False Then
					
						oCompDef.Unfold
						
					Else
					
   						oCompDef.FlatPattern.Edit
						
					End If

					Dim sOut As String
					
					'this assigns colors to the different layers, this can also be modified
				
					sOut = "FLAT PATTERN DXF?AcadVersion=2004" _
					+ "&OuterProfileLayer=OUTER_PROF&OuterProfileLayerColor=255;165;0" _
					+ "&InteriorProfilesLayer=INNER_PROFS&InteriorProfilesLayerColor=124;252;0" _
					+ "&FeatureProfileLayer=FEATURE&FeatureProfileLayerColor=255;0;255" _
					+ "&ArcCentersLayer=CENTERS&ArcCentersLayerColor=135;206;235" _
					+ "&IV_Arc_Centers&InvisibleLayers=IV_Tangent;IV_Bend;IV_Bend_Down;IV_Bend_Up&IV_Arc_Centers&InvisibleLayersColor=135;206;235"

					
					oCompDef.DataIO.WriteDataToFile( sOut, oDataMedium.FileName)
				
					'just for checking to see if its works coretcly
					'i=MessageBox.Show(oDataMedium.FileName, "Title",MessageBoxButtons.OKCancel)
					
					'MessageBox.Show(i,"title",MessageBoxButtons.OK)
				
					'If i=2 Then
				
						'Exit Sub
				
					'End If

					oCompDef.FlatPattern.ExitEdit
				
				Catch
				
				End Try
                
				oDrawDoc.Close
				
			Else
					
			End If
			
		Next

Jason

JasonMayes
Advocate
Advocate

@chandra.shekar.g  

Can you help with this?

Thanks,

Jason

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

@JasonMayes,

 

There are 2 issues. One is Inventor crash on running iLogic (generating dxf from sheet metal). Another issue is to deletion of holes and left with only hole centers.

 

Please validate the issues.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

JasonMayes
Advocate
Advocate

@chandra.shekar.g  Please see my post referenced in attached picture. The thread that I think you are referring to was my reply to a request for how we handle assembly level def exports. That process seems to work good as long as we run in from a fresh start on Inventor otherwise it will crash. I am guessing at has something to do with the cache. If you have another way around this please feel free to help. I am more curious about my other post regarding the removal of hole with a smaller diameter only leaving the center mark. See photo of post.

 

Jason170D4AE3-6569-4AC6-AFB7-59F9A556CC38.png

0 Likes

HermJan.Otterman
Advisor
Advisor

following the workflow that @MechMachineMan described I made a pice of code that will create the automated centerlines and move the circles to an other layer.

what you have to do, and maybe write code for it if you didnot do that already:

1 open the sheet metal part

2 create a new drawing of it

3 delete evreything from it like bordes, this is to get the right dxf output (better create an empty template and use that)

4 place one view of the flatpattern

5 Run my code, you can alter the layer, and the values for the radius

6 save as DXF, (mind you, don't use "model geometry only" this will remove the centerlines)

 

see my screencast:

 

 

 

 

the code:

Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
        Dim oActiveSheet As Inventor.Sheet = oDrawDoc.ActiveSheet

        Dim oDrawView As DrawingView = Nothing

        Dim hiddenLayer As Layer = oDrawDoc.StylesManager.Layers("Hidden")


        For Each oDrawView In oActiveSheet.DrawingViews

            Dim autoCenterSet As AutomatedCenterlineSettings
            oDrawView.GetAutomatedCenterlineSettings(autoCenterSet)

            autoCenterSet.CircularEdgeMaximumThreshold = 1.2 '12 mm

            'create automated centerlines:
            oDrawView.SetAutomatedCenterlineSettings(autoCenterSet)

            Dim oDrawCurve As DrawingCurve = Nothing
            For Each oDrawCurve In oDrawView.DrawingCurves
                Dim drawCurveSeg As DrawingCurveSegment
                For Each drawCurveSeg In oDrawCurve.Segments
                    If drawCurveSeg.GeometryType = Curve2dTypeEnum.kCircleCurve2d Then
                        If drawCurveSeg.Geometry.Radius < 0.6 Then  '6 mm
                            'change layer
                            drawCurveSeg.Layer = hiddenLayer
                        End If
                    End If
                Next

            Next

        Next

        hiddenLayer.Visible = False

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan