Cancel
Showing results for 
Search instead for 
Did you mean: 

pdf of model from draft

Hi All

I have a windows form app that takes selected properties of the open draft and adds them to a database and also takes a PDF and puts it in a folder on the sever.

I’ve also written another app to put a 3D PDF from an open part/assembly and put that in a folder.

I now need to combine these so they both work from the app in draft, how would I get that app to open the base model and then run the code to 3d pdf it.

Im using VB by the way

Regards

Steve

7 REPLIES

Re: pdf of model from draft

Phenom
Phenom

Start with the draft file and you can get the models linked to it.

Then it would be a case of opening each model and creating a 3d pdf.

 

If you haven't already done so I would download Jason Newell's Spy for Solid Edge - will show you everything you need to know about Solid Edge files.

 

The link is on this pinned thread -

 Useful Solid Edge Developer Community Links

 

HP Z420 16GB RAM
Quadro K4000
ST10 MP6 on Windows 10 Pro 64.

Re: pdf of model from draft

"Start with the draft file and you can get the models linked to it." this is my sticking point in how to ref & open the linked models programmatically with VB.net "Then it would be a case of opening each model and creating a 3d pdf." if an assembly I just need a pdf of that not a pdf of each part. have tried looking at SE Spy before but I don't understand what its telling meSmiley Happy Steve
Highlighted

Re: pdf of model from draft

Phenom
Phenom

Open a draft file and start Spy.

At the top you have Application

Expand that and you should then see Documents

Expand Documents and you will see Item(1)

Expand Item(1) and you will see ModelLinks, with the number of linked models in []

Click on ModelLinks and in the right pane you will see the Count property

Expand ModelLinks and again you will see a list of items - these are the models linked to the draft file.

We often detail several parts on one draft but if you use a one-draft-one-model approach you will only see Item(1)

Click on the item and again in the right pane you should now see FileName.

This is the path to open the model, then you can create the 3d pdf.

 

This same structure also appears under ActiveDocument - which is where you need to start if your program has the draft open.

Active Document > Model Links > Item(1) etc

 

I'm not enough of a regular programmer to write the code off the top of my head - maybe someone else can do that - but this should point you in the right direction.

HP Z420 16GB RAM
Quadro K4000
ST10 MP6 on Windows 10 Pro 64.

Re: pdf of model from draft

Hi thats great thanks, I have that part working now.

I need it now to determine whether the model link file that is opened is a part file or assembly file,

 how would I code that?

maybe something like IF SE.activedocument = SE.partdocument then?

am I thinking along the right lines?

 

Steve

 

Re: pdf of model from draft

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The ActiveDocument is your draft document, so your IF condition would never be true.

You should check the ModelLink.ModelType property against ModelLinkTypeConstants.igPartLink or ModelLinkTypeConstants.igAssemblyLink to distinguish between both types.

Re: pdf of model from draft

HI Martin

I have set it to open the model link file so that then becomes the active document, then it detemines if its a part or assembly or is it better to check the type before it opens it?

 

Re: pdf of model from draft

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Depends on the workflow of your macro, e.g whether to open the files differently or not for different types.

If you need to check BEFORE opening the document, then have a look at the ModelLink.ModelType property.

If you need to check AFTER opening the document, then look for the Application.ActiveDocumentType property.