- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am attempting to change the Style of a Mark located on a sheet metal flat pattern. The code below fails at "oMarkDef.Style.name = "Mark Surface" and I am not sure why. Can someone help point me in the correct direction. Thank you.
' Create a new part document. Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition For Each oMarkDef In oCompDef.Flatpattern.Features.item("Etch Info").definition oMarkDef.Style.name = "Mark Surface" Next
error:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateSet(Object o, Type& objType, String name, Object[] args, String[] paramnames, Boolean OptimisticSet, CallType UseCallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSetComplex(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase)
Solved! Go to Solution.