<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dimension to Description Relation in 3D Part &amp; Assembly Design</title>
    <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481186#M30055</link>
    <description>&lt;P&gt;You&amp;nbsp;do not need the &amp;amp; before the parameter in a relation.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DESC = "THIS IS" + LENGTH&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2017 14:01:10 GMT</pubDate>
    <dc:creator>BenLoosli</dc:creator>
    <dc:date>2017-08-09T14:01:10Z</dc:date>
    <item>
      <title>Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481126#M30049</link>
      <description>&lt;P&gt;I am creating family table components. The probelem I have is that, I cant enter description for all instances of family table, so i created a relation like&lt;/P&gt;
&lt;P&gt;DESCRIPTION=" BOLT DIA &amp;amp;DIAMETER IN , &amp;amp;LENGTH IN LONG"&lt;/P&gt;
&lt;P&gt;so that it will display like,&lt;/P&gt;
&lt;P&gt;BOLT DIA 1 IN, 2 IN LONG&lt;/P&gt;
&lt;P&gt;Instead it displays like,&amp;nbsp;&lt;SPAN&gt;BOLT DIA &amp;amp;DIAMETER IN , &amp;amp;LENGTH IN LONG in the description.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can someone say whats wrong with the expression ??&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Santhosh&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 13:53:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481126#M30049</guid>
      <dc:creator>SEaswaran2</dc:creator>
      <dc:date>2018-12-07T13:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481135#M30050</link>
      <description>&lt;P&gt;The double quote tells the relation to use the literal characters instead of interpreting them as parameter flags.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need something like DESC = "THIS IS " + &amp;amp;LENGTH + " A TEST"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edited later - "&amp;amp;" is not needed and Creo won't convert a Real to a String. I confused it with the way Drawing Notes work. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;rant&amp;gt; It's easy to forget that Creo is one of the few languages besides 6502 Assembler that is unable to make this conversion. Thousands of languages have been created and the only ones without it are ones without any floating point support at all. It's an amazingly brutal oversight, given how much this lack of conversion from Real to String and String to Real hurts users of Creo Relations. It's like there was a meeting and this was purposely done, though I have no good guess as to why. &amp;lt;/rant&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 22:02:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481135#M30050</guid>
      <dc:creator>dschenken</dc:creator>
      <dc:date>2017-08-09T22:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481136#M30051</link>
      <description>&lt;P&gt;Well, the problem is you are assigning the literal value &lt;SPAN&gt;" BOLT DIA &amp;amp;DIAMETER IN , &amp;amp;LENGTH IN LONG" (because of the quotation marks) - to the string type parameter DESCRIPTION.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I think in Creo relations, in order to join strings together, you have to use the + operation, like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DESCRIPTION="BOLT DIA" + itos(DIAMETER) + "IN., " + ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Also see:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/Creo-Modeling-Questions/How-to-adjust-decimal-places-in-a-parameter/m-p/475500" target="_self"&gt;How-to-adjust-decimal-places-in-a-parameter&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/Creo-Modeling-Questions/Parameters-and-relations/m-p/411992" target="_self"&gt;Parameters-and-relations&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 06:46:12 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481136#M30051</guid>
      <dc:creator>psobejko</dc:creator>
      <dc:date>2017-08-09T06:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481138#M30052</link>
      <description>&lt;P&gt;There is a more comprehensive list:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/Creo-Modeling-Questions/Converting-Real-Numbers-to-Strings/m-p/189624" target="_blank"&gt;https://community.ptc.com/t5/Creo-Modeling-Questions/Converting-Real-Numbers-to-Strings/m-p/189624&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PTC missed the boat on this. There are two ways to go in every other programming language. Either provide a Real to String conversion with an optional decimal control -OR- provide a String to Real conversion so that the values can be pulled from the Description. PTC took the middle road and did neither.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 07:02:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481138#M30052</guid>
      <dc:creator>dschenken</dc:creator>
      <dc:date>2017-08-09T07:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481145#M30053</link>
      <description>&lt;P&gt;If I use&amp;nbsp;&lt;SPAN&gt;DESC = "THIS IS" + &amp;amp;LENGTH&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;it displays "Invalid data type combination at right side of expression"&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 08:27:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481145#M30053</guid>
      <dc:creator>SEaswaran2</dc:creator>
      <dc:date>2017-08-09T08:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481160#M30054</link>
      <description>&lt;P&gt;You can't mix types in an assignment statement.&amp;nbsp; You need to convert the value from a real number to a text string. Unfortunately, Creo and ProE before it has consistently provided no simple "real to string" function. 20+ years in the business and they don't give us a simple freshman year programming problem solution. What we do have is a function to convert an integer value to a string, and a means of extracting a portion of a string. With these two and some logic we can "build" the string we want.&lt;/P&gt;
&lt;P&gt;Let's assume you want a real number with three decimal places. Here's how I'd get a string from the actual value, in relations code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--- [ Begin Relations Code ] ---&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;numDigits = 3&lt;/P&gt;
&lt;P&gt;/*&lt;/P&gt;
&lt;P&gt;/* Get the integer portion of the number. Negative numbers have to be&lt;/P&gt;
&lt;P&gt;/* handled differently because of the need for "floor". floor ( -1.9 ) = -2, which&lt;/P&gt;
&lt;P&gt;/* isn't what we're looking for.&lt;/P&gt;
&lt;P&gt;/*&lt;/P&gt;
&lt;P&gt;stringValue = ""&lt;BR /&gt;IF realValue &amp;lt; 0.0&lt;BR /&gt;&amp;nbsp; stringValue = stringValue + "-"&lt;BR /&gt;ENDIF&lt;BR /&gt;IF ABS( realValue ) &amp;lt; 1.0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stringValue =&amp;nbsp; stringValue + "0."&lt;BR /&gt;ELSE&lt;BR /&gt;&amp;nbsp; stringValue = ITOS ( FLOOR ( ABS ( realValue ) ) )&amp;nbsp; + "."&lt;BR /&gt;ENDIF&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*&lt;/P&gt;
&lt;P&gt;/* Now, add on the desired digits after the decimal place.&lt;/P&gt;
&lt;P&gt;/*&lt;/P&gt;
&lt;P&gt;stringValue = stringValue + EXTRACT ( ITOS ( 10^numDigits * ( 1 + abs ( realValue ) - floor ( abs ( realValue ) ) ) ), 2, numDigits )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--- [ End Relations Code ] ---&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's a lot of stuff to do a "simple" conversion, but there you go.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:24:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481160#M30054</guid>
      <dc:creator>KenFarley</dc:creator>
      <dc:date>2017-08-09T11:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481186#M30055</link>
      <description>&lt;P&gt;You&amp;nbsp;do not need the &amp;amp; before the parameter in a relation.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DESC = "THIS IS" + LENGTH&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 14:01:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481186#M30055</guid>
      <dc:creator>BenLoosli</dc:creator>
      <dc:date>2017-08-09T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481233#M30056</link>
      <description>&lt;P&gt;It's not just the "&amp;amp;", you can't add a numeric value to a string. If only it were that easy...&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 17:03:50 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481233#M30056</guid>
      <dc:creator>KenFarley</dc:creator>
      <dc:date>2017-08-09T17:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481249#M30057</link>
      <description>&lt;P&gt;These are always fun to do. &amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://www.ptcusercommunity.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; Here is a fully functional code block.&amp;nbsp; This is based on the dimensions being named &lt;STRONG&gt;LENGTH&lt;/STRONG&gt; and &lt;STRONG&gt;DIAMETER&lt;/STRONG&gt;.&amp;nbsp; You will need to change the code if they are actually named something different.&amp;nbsp; Let me know if you have any questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Logic to convert DIAMETER and LENGTH to strings
/* and then include them in the DESCRIPTION parameter.

/* Number of Digits
ND = 3

/* Convert LENGTH
LEN_STR = ""
RN = FLOOR((LENGTH+(5/10^(ND+1))),ND)
IF FLOOR(RN) == 0
    LEN_STR = "0."+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ELSE
    LEN_STR = ITOS(FLOOR(RN))+"."+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ENDIF

/* Convert DIAMETER
DIA_STR = ""
RN = FLOOR((DIAMETER+(5/10^(ND+1))),ND)
IF FLOOR(RN) == 0
    DIA_STR = "0."+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ELSE
    DIA_STR = ITOS(FLOOR(RN))+"."+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ENDIF

/* Generate DESCRIPTION
DESCRIPTION = "BOLT DIA " + DIA_STR + " IN, " + LEN_STR + " IN LONG"&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 17:46:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/481249#M30057</guid>
      <dc:creator>TomU</dc:creator>
      <dc:date>2017-08-09T17:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension to Description Relation</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/915973#M132361</link>
      <description>&lt;P&gt;Awesome i have been looking for this formula for long time.&lt;BR /&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/3358"&gt;@TomU&lt;/a&gt;&amp;nbsp;I Appreciate the effort and solution.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 14:01:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/Dimension-to-Description-Relation/m-p/915973#M132361</guid>
      <dc:creator>Harsh_Raaj_Raaj</dc:creator>
      <dc:date>2023-12-01T14:01:49Z</dc:date>
    </item>
  </channel>
</rss>

