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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Get Drawing Scale for mult. Sheets and Model files

RPN
17-Peridot
17-Peridot

Get Drawing Scale for mult. Sheets and Model files

I'm asking for a work around, because Toolkit will not work proper in the following scenario (my guess).

 

You have ONE Drawing with 2 Models

BOX.PRT is active at sheet 1

and

CYL.PRT is active at sheet 2

 

You get the scale with: ProDrawingScaleGet(drawing,solid,sheet,*scale)

 

If sheet 1 is active, the function  ProDrawingCurrentsolidGet() will return BOX.PRT, and now I have the Drawing, the Solid and the Sheet to get the scale, so far - so good.

But if I activate sheet 2 via Toolkit, ProDrawingCurrentsolidGet() will return BOX.PRT again which is not correct.

 

There is no function to Update the Model Tree. The Drawing tree can be updated but the Model Tree will not reflect the change if I switch to Sheet 2 and display the Model Tree of the CYL.PRT.

 

Do I miss something here, or is there a trick. I tried ProDwgSheetRegenerate, Refresh Wind, Solid Model Tree, Regen and so on. But the call to ProDrawingCurrentsolidGet() will always return the model for the sheet number before changing it. 

 

Does someone has a work around, to get the displayed scale for each sheet of a drawing in this scenario?

8 REPLIES 8
MartinHanak
24-Ruby III
(To:RPN)

Hi,

when working with Creo multimodel drawing, user has to set active model - see Creo 10 picture below. Perhaps there is a method that represents this function. You can ask PTC Support ...

MartinHanak_0-1757507343232.png

 


Martin Hanák
msteffke
14-Alexandrite
(To:RPN)

Perhaps you could try getting the scale from the view instead of the drawing.  This what I do because I rescale the view that contains sheetmetal flat that is parametric driven.   Our drawings are created in a consistent manner so I can make some assumptions about qty of views, but this may work for you.

 

ProDrawingViewsCollect(p_draw, &views);

for each view:

     ProDrawingViewSolidGet(p_draw, views[view], &solid);

     ProDrawingViewSheetGet(p_draw, views[view], &sheet);

   >>>  logic here to get intended sheet and model  <<<

 

err = ProDrawingViewScaleGet(p_draw, views[viewinc], &VScale);

 

 

RPN
17-Peridot
17-Peridot
(To:msteffke)

Yes, with this I can get the scale, but this may not reflect the value in the title block, and this is the one I would need😩. Worst case is to parse the drawing table 😵💫 at the current sheet.

msteffke
14-Alexandrite
(To:RPN)

Another suggestion:  use the view functions in order identify the solid in the view in sheet 2, then pass that solid to  ProDrawingScaleGet(drawing,solid,sheet,*scale) function you were using 

 

ProDrawingViewsCollect(p_draw, &views);

for each view:

     ProDrawingViewSolidGet(p_draw, views[view], &solid);

     ProDrawingViewSheetGet(p_draw, views[view], &sheet);

   >>>  logic here to get intended sheet and model  <<<

 

ProDrawingScaleGet(drawing,solid,sheet,*scale)

Catalina
Moderator
(To:RPN)

Hi @RPN,

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.


Of course, if you have more to share on your issue, please pursue the conversation.

Thanks,


Catalina
PTC Community Moderator
PTC
RPN
17-Peridot
17-Peridot
(To:Catalina)

Thanks to the respond off Mr. Steffke, but I was looking for a Toolkit Call to get the right scale value, which is displayed in the title block of a drawing. I will try now to look by the owner of the title block table or a displayed parameter value.

 

ProDrawingScaleGet() needs the drawing and the solid

 

ProDrawingCurrentsolidGet() provides the current Solid

 

After calling ProDrawingCurrentSheetSet() the Current Solid is not updating, the result of  ProDrawingScaleGet may now fail because the solid for the active sheet may now invalid. AT the end I need to know which model was active on inserting the format, or where is the value from. I will investigate ProDwgtable* Calls, maybe this is more succesfully.

 

ProDtlnoteModelrefGet() seems to work, but this makes ProDrawingScaleGet() worthless on working with multiple model files in one drawing. The Tollkit Call is not updating the active model on switching the sheet, this is an issue in my point of view. On the other hand all this calls need some rework in my point of view. And for this you need to know Row/Col of the scale display 😞

 

ProDwgtableCellNoteGet

  ProDtlnoteDataGet

    ProDtlnotedataLinesCollect

      ProDtlnotelineTextsCollect

        ProDtlnoteModelrefGet

 

Uff  🙂

 

FabianWolf
14-Alexandrite
(To:RPN)

Hi RPN,

what you can alternatively do is to create a temporary ProDtlnote on the first sheet with text "&scale" and free attachment somewhere. Then use ProDtlnoteDataGet with PRODISPMODE_NUMERIC and get the note text again which is now the resolved callout like e.g. "5:1".

After this you can switch to another sheet using ProDrawingCurrentSheetSet and repeat the procedure.

Of course, this will mark the drawing as changed. Potentially this might be addressed using ProMdlnameCopy.

Hope this helps.

 

RPN
17-Peridot
17-Peridot
(To:FabianWolf)

Hello Fabian, yes this may an option. But after some test I will search the Title Block and use ProDtlnoteModelrefGet, I hope this is save, because the active model may not the owner of the displayed text in the title block. So the usage of ProDrawingScaleGet() is no longer clear for me, but I can live with that 🙂

Announcements

Top Tags