Zepmanbc / creopyson

Python library for Creoson (http://www.creoson.com)
MIT License
57 stars 5 forks source link

Template name passed to drawing in WindChill with drawing_create #19

Open victoman1234 opened 4 years ago

victoman1234 commented 4 years ago

Description

Using the drawing_create command to create and save to windchill a new drawing with the Part Name as the Drawing Name.

The drawing is created properly but the name of the selected Drawing Template is used as the name of the new drawing in WindChill. The new drawing has the correct File Name, has the correct Number but does not have the correct name in WindChill.

import creopyson
c = creopyson.Client()
c.connect()
c.server
cprint = c.sessionId
print("\n" + "session Id = " + cprint)
c.drawing_create("bmh_d_eng_detail")
c.disconnect()

2020-07-17 14_31_02-HEXBOLT-1_2-13X1_5 Rev_ New 0 0+ In Work  (Active) - Creo Parametric

davidhbigelow commented 4 years ago

IS that the PTC_COMMON_NAME that is not changing? If so - you have to set that as a parameter value .... I believe.

Dave

On Fri, Jul 17, 2020 at 2:40 PM victoman1234 notifications@github.com wrote:

  • Creopyson version: 0.5.2
  • Creoson version: 2.6.0
  • Python version: 3.7
  • Operating System: Windows 10 Pro 64-bit

Description

Using the drawing_create command to create and save to windchill a new drawing with the Part Name as the Drawing Name.

The drawing is created properly but the name of the selected Drawing Template is used as the name of the new drawing in WindChill. The new drawing has the correct File Name, has the correct Number but does not have the correct name in WindChill.

What I did

import creopyson c = creopyson.Client() c.connect() c.server cprint = c.sessionId print("\n" + "session Id = " + cprint) c.drawing_create("bmh_d_eng_detail") c.disconnect()

[image: 2020-07-17 14_31_02-HEXBOLT-1_2-13X15 Rev New 0 0+ In Work (Active) - Creo Parametric] https://user-images.githubusercontent.com/68441212/87819976-340b4180-c83b-11ea-8fb6-7ba9e21c9588.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJLY26CYKN4MDLTJXJ3R4CLK7ANCNFSM4O6WLQMQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

adama2000 commented 4 years ago

In the creoson code, there is a section where it sets the drawing's "common name" to the drawing's root file name -- but ONLY if Creo says that the common name is modifiable. Essentially, this:

 if (drw.IsCommonNameModifiable()) { // Creo call
      String commonName = (drawing's file name with the extension

removed) drw.SetCommonName(commonName); // Creo call } else (print a line to error output that the common name could not be modified)

I'm guessing that the "common name" corresponds to PTC_COMMON_NAME, and maybe something's set so it can't be modified.

Adam Andrews

On Fri, Jul 17, 2020 at 6:03 PM David Bigelow notifications@github.com wrote:

IS that the PTC_COMMON_NAME that is not changing? If so - you have to set that as a parameter value .... I believe.

Dave

On Fri, Jul 17, 2020 at 2:40 PM victoman1234 notifications@github.com wrote:

  • Creopyson version: 0.5.2
  • Creoson version: 2.6.0
  • Python version: 3.7
  • Operating System: Windows 10 Pro 64-bit

Description

Using the drawing_create command to create and save to windchill a new drawing with the Part Name as the Drawing Name.

The drawing is created properly but the name of the selected Drawing Template is used as the name of the new drawing in WindChill. The new drawing has the correct File Name, has the correct Number but does not have the correct name in WindChill.

What I did

import creopyson c = creopyson.Client() c.connect() c.server cprint = c.sessionId print("\n" + "session Id = " + cprint) c.drawing_create("bmh_d_eng_detail") c.disconnect()

[image: 2020-07-17 14_31_02-HEXBOLT-1_2-13X15 Rev New 0 0+ In Work (Active) - Creo Parametric] < https://user-images.githubusercontent.com/68441212/87819976-340b4180-c83b-11ea-8fb6-7ba9e21c9588.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/19, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAMSRJLY26CYKN4MDLTJXJ3R4CLK7ANCNFSM4O6WLQMQ

.

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/19#issuecomment-660356113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANPKPHNJTNUDPZC52GYLI3R4DDC5ANCNFSM4O6WLQMQ .

davidhbigelow commented 4 years ago

PTC_COMMON_NAME can be set by a parameter set call... I am pretty sure (assuming that is the issue / solution).

On Fri, Jul 17, 2020 at 9:31 PM adama2000 notifications@github.com wrote:

In the creoson code, there is a section where it sets the drawing's "common name" to the drawing's root file name -- but ONLY if Creo says that the common name is modifiable. Essentially, this:

if (drw.IsCommonNameModifiable()) { // Creo call String commonName = (drawing's file name with the extension removed) drw.SetCommonName(commonName); // Creo call } else (print a line to error output that the common name could not be modified)

I'm guessing that the "common name" corresponds to PTC_COMMON_NAME, and maybe something's set so it can't be modified.

Adam Andrews

On Fri, Jul 17, 2020 at 6:03 PM David Bigelow notifications@github.com wrote:

IS that the PTC_COMMON_NAME that is not changing? If so - you have to set that as a parameter value .... I believe.

Dave

On Fri, Jul 17, 2020 at 2:40 PM victoman1234 notifications@github.com wrote:

  • Creopyson version: 0.5.2
  • Creoson version: 2.6.0
  • Python version: 3.7
  • Operating System: Windows 10 Pro 64-bit

Description

Using the drawing_create command to create and save to windchill a new drawing with the Part Name as the Drawing Name.

The drawing is created properly but the name of the selected Drawing Template is used as the name of the new drawing in WindChill. The new drawing has the correct File Name, has the correct Number but does not have the correct name in WindChill.

What I did

import creopyson c = creopyson.Client() c.connect() c.server cprint = c.sessionId print("\n" + "session Id = " + cprint) c.drawing_create("bmh_d_eng_detail") c.disconnect()

[image: 2020-07-17 14_31_02-HEXBOLT-1_2-13X15 Rev New 0 0+ In Work (Active) - Creo Parametric] <

https://user-images.githubusercontent.com/68441212/87819976-340b4180-c83b-11ea-8fb6-7ba9e21c9588.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/19, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AAMSRJLY26CYKN4MDLTJXJ3R4CLK7ANCNFSM4O6WLQMQ

.

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/Zepmanbc/creopyson/issues/19#issuecomment-660356113 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AANPKPHNJTNUDPZC52GYLI3R4DDC5ANCNFSM4O6WLQMQ

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Zepmanbc/creopyson/issues/19#issuecomment-660402407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJPRY3WUBLXHZQF4MMLR4D3P7ANCNFSM4O6WLQMQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

phaleth commented 4 years ago

For a CAD document the Name in Windchill is the PTC_COMMON_NAME in Creo Parametric.

adama2000 commented 3 years ago

@victoman1234 did you try setting the PTC_COMMON_NAME parameter on the drawing?

PiNandanwar commented 3 years ago

I am not the original user who created this ticket, but I also noticed this issue when creating a drawing.

The one thing I was able to figure out is that if I were to manually create the drawing with the same name, model, and template the PTC_WM_NAME parameter is the same as the drawing.

When I programmatically create the drawing using the Creopyson.drawing.create function, that is when the PTC_WM_NAME variable autofills the template name for that parameter. That parameter is also locked so I cannot just update it with the correct value.

Another thing is that the parameter is only assigned the template name value when I save the drawing. If I just create the drawing in session and do not save, that parameter is empty. However, once I save it, either manually or programmatically, the parameter is assigned the template name.