cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Faster way to open drawing of a part or assembly

SEEBO
6-Contributor

Faster way to open drawing of a part or assembly

Hello,

 

I am using creo elements/direct modeling version 20.6. I have noticed that it's still not possible to open a drawing straight from the model tree. Would it be possible to write a script or custom command to do this? Because now you have to go to the masterdata first and find the drawing there. 

 

Other solutions for this problem are also welcome.

 

Kind regards.

Siebe

4 REPLIES 4

Hi SV_7256125,


Thank you for your question. 
I’d like to recommend to bring more details and context to your initial inquiry

It also helps to have screenshot(s) to better understand what you are trying to do in your process. 

This will increase your chances to receive meaningful help from other Community members. 

Regards,

Community Moderation Team

SEEBO
6-Contributor
(To:vnamboodheri)

Hello,

 

I will try and explain what i want to do. I used to work with autodesk inventor. In that software i could right click on a part/assembly in de model tree (see screenshot) and click "open drawing" and it would open the drawing that was linked with that part/assembly. I would like something like this for creo elements/direct (if it is possible though) either with a custom command or macro or something. The way we do it now is get the masterdata from that part and open the drawing from there. I could save a decent amount of clicks if i could open the drawing directly from the model tree.

 

I hope this is a bit more clear as to what i wanna do.

 

Kind Regards

SEEBO

SEEBO_1-1705564113713.png

 

 

 

Just add it to your popup menu.

 

ThomasKirkman_0-1723225273264.png

 

 

 

Creo Element\Direct Modeling 20.6.0.0.0


@SEEBO wrote:

Hello,

 

I am using creo elements/direct modeling version 20.6. I have noticed that it's still not possible to open a drawing straight from the model tree. Would it be possible to write a script or custom command to do this? Because now you have to go to the masterdata first and find the drawing there. 

 

Other solutions for this problem are also welcome.

 

Kind regards.

Siebe


a script or custom command could indeed streamline your workflow in Creo Elements/Direct Modeling. While I couldn’t find a specific script for this exact task, you can create a custom command using the LISP programming language, which is supported by Creo Elements/Direct Modeling.

Here’s a basic outline of how you might approach this:

Create a LISP Script: Write a LISP script that searches for the drawing associated with the selected model and opens it.
Load the Script: Load the script into Creo Elements/Direct Modeling.
Assign the Command: Assign the custom command to a toolbar button or a menu item for easy access.
Example LISP Script
Here’s a simple example to get you started. This script assumes you have a function to find and open the drawing based on the selected model:

(defun open-drawing-from-model ()
(let* ((model (sd-inq-curr-part))
(drawing (find-drawing-for-model model)))
(if drawing
(sd-call-cmds (sd-display-drawing drawing))
(format t "No drawing found for the selected model."))))

(defun find-drawing-for-model (model)
;; Implement your logic to find the drawing associated with the model
;; This is a placeholder function
(some-function-to-find-drawing model))

(sd-defdialog 'open-drawing-dialog
:dialog-title "Open Drawing from Model"
:variables '((model :value-type :part))
:ok-action '(open-drawing-from-model))

(sd-create-menu-item "Open Drawing from Model" 'open-drawing-dialog)

Steps to Implement
Write the Script: Save the script as a .lsp file.
Load the Script: In Creo Elements/Direct Modeling, go to File > Load > LISP File and load your script.
Assign the Command: You can add the command to a toolbar or menu for easy access.
Additional Resources
For more detailed information on scripting and custom commands in Creo Elements/Direct Modeling, you can refer to the PTC Help Center and the Creo Elements/Direct Modeling Documentation

Announcements


Top Tags