Why not implement an "open draft" button?

Creator
Creator

Hello to everyone

 

I just find very useful implement a button "open draft" from the part, sheet or assembly environment.

 

Other programs like solidwors have a button that open directly the drawing of the part you are watching, and it is very useful because you don't need always to find and open by your own the draft of the part.

 

Maybe this post is focused on admins and SE developers, but is interesting to discover if someone else can find it helpful (it can be considered an Enhancement Request).

Tell me in the comments!

 

Giorgio

16 REPLIES

Re: Why not implement an "open draft" button?

Phenom
Phenom

I have made a simple macro that opens the draft file in case it have the same name and same location.

 

In case you are in assembly and one or more occourences are selected, it opens theyr drafts (if exists and match the above conditions).

 

See attachment

 

Betreff: Why not implement an "open draft" button?

Honored Contributor
Honored Contributor

Hi @STCimola

 

 

besides that one part might be related to more than one draft document You can do it when using ST9 and the BuildIn-Data-Management.

 

A "Where Used" search shows every document to which this part will be related and a click on the according line (doc) opens that one for You.

 

Besides this - very new functionallity - I remember an old AddIn for SE,
where from a draft file back to the part a property is saved which could be used to open the draft from part again.

 

 



regards
Wolfgang

Re: Why not implement an "open draft" button?

Valued Contributor
Valued Contributor

Hello fiorini
This seems very useful.
But it seems to work only if it is in the same path.
I hope it works even if it is located in a subdirectory or a parent directory.
You can use the Find where used item in the SDK code.

You can add find where used to the feature
Can you make a new one?
Please.

When you select a part in the assembly and run the macro
I hope the draft document that was on the path is open.

 

Could you share this code?
The code that recognizes a part in an assembly
I want to know.

Re: Why not implement an "open draft" button?

Creator
Creator

Thank you so much! Where I have to add the macro to use it?

Betreff: Why not implement an "open draft" button?

Creator
Creator

Thanks @hawcad, but I tried to use there applications (except the old se addin), but they are too difficult to use normally and also to explain to my colleagues.

 

I need something more easy and immediate to use, like @Fiorini's solution.

 

Thank you!

Re: Why not implement an "open draft" button?

Phenom
Phenom

Hclee wrote:

Hello fiorini
This seems very useful.
But it seems to work only if it is in the same path.
I hope it works even if it is located in a subdirectory or a parent directory.
You can use the Find where used item in the SDK code.

You can add find where used to the feature
Can you make a new one?
Please.

When you select a part in the assembly and run the macro
I hope the draft document that was on the path is open.

 

Could you share this code?
The code that recognizes a part in an assembly
I want to know.


It look only in the folder where the selected occourence is located.

I don't use the where used function because for my purpose is not relevant and I don't want to wait for the DFTs to be found.

 

 

Here a snip of the code

 

        Count = objAsm.SelectSet.Count
        If Count = 0 Then
            name = objAsm.FullName
        Else
            For i = 1 To Count
                name = objAsm.SelectSet(i).object.OccurrenceDocument.FullName
                l = Len(name)
                dftname = Left(name, l - 3) + "dft"
                If file_exist(dftname) Then
                    objDft = objApp.Documents.Open(dftname)
                End If
                name = ""
            Next
        End If

Re: Why not implement an "open draft" button?

Phenom
Phenom

STCimola wrote:

Thank you so much! Where I have to add the macro to use it?


Just add it in Part, SheetMetal and Assembly it doesn't matter if in quickbar or a customized ribbon

 

Re: Why not implement an "open draft" button?

Creator
Creator
It works perfectly, thank you so much!

Re: Why not implement an "open draft" button?

Valued Contributor
Valued Contributor

Thank you very much.