Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro: opening part from drawing

Status
Not open for further replies.

Redrum555

Mechanical
May 9, 2011
1
Hello,

I'd like to have a piece of code that allow me to open and close a part configuration from the drawing.(I was able to do it the other way around part to drawing but I'm stuck with drawing to part)

(If you wonder why here is the reason:
The user shall have access only to the drawing file and use a textbox to change a dimension that involve conditions on other dimensions. So I need to open the 3d part in order to update the design table and close it right after the update...)
 
Replies continue below

Recommended for you

You need to do this from a drawing view. Get the drawing object, then a sheet, then a view, then get view's referenced part.
 
Just for clarity, here is what I was responding to from the OP: "The user shall have access only to the drawing file and use a textbox to change a dimension that involve conditions on other dimensions. So I need to open the 3d part in order to update the design table and close it right after the update"

In my opinion, the change should be driven from the design library, as this is how SolidWorks functions. If you wish to change the drawing and then manually update the model separately afterwards, it seems to me that you are trying to implement a redline system. The SW drawing doesn't work like that.

To address your actual question, I differ to Tick's comment.

Matt Lorono, CSWP
Lorono's SolidWorks Resources & SolidWorks Legion
Follow me on Twitter
 
Redrum555 are you trying to access the drawing file from some other application besides SWX? If the user has SWX to open the drawing they can just open the part file from there, no?

--
Hardie "Crashj" Johnson
SW 2011 SP 2.0
HP Pavillion Elite HPE
W7 Pro, Nvidia Quaddro FX580

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor