Hi there,
I have sucessfully made a macro to create a new drawing from an assembly, acessing each part's features and put them in different layers.
Now... I have to make the same thing for a single part drawing and i cant seem to access the (only) component features...
Note that in a assembly drawing, my code works perfectly....
This is the code i use (i've tried many other ways, but this SHOULD work... i guess)
Set swApp = Application.SldWorks
Set swddoc = swApp.ActiveDoc
Set view = swddoc.ActiveDrawingView
Set dcomp = swview.RootDrawingComponent
Debug.Print dcomp.Name
Set feat = dcomp.Component.FirstFeature
Well, my debug shows CORRECTLY the name of the component... so far so good, but my feat var... should have a value, because the object has a lot of features
But no.... the .Component doesnt return what it should and the macro crashes... all the time, no matter what part i put in the drawing...
I then tried:
comp = view.GetVisibleComponents(0)
feat = comp.FirstFeature
Same result: the comp var returns the correct name of the component... but not his features..
Again... if i run this on a assembly drawing... this works perfectly...
Any one can help me on this?
Thanks
SolidworksApi macros