顯示具有 Relation 標籤的文章。 顯示所有文章
顯示具有 Relation 標籤的文章。 顯示所有文章

2016年11月10日 星期四

[Creo Skill] Pattern Relation #1

Pattern Relation是一種進階的技巧,主要是運用在不等距的Pattern陣列中;
而通常 Pattern Relation 在一維的尺寸控制是不困難的,難的是二維的尺寸控制怎麼作?


Pattern Relation

1) Definition:

/=====================================================/
memb_v - relation driven resultant dimension in this specific direction
memb_i - relation driven increment in this specific direction
lead_v - leader value (dimension selected to determine direction)
idx1   - pattern instance index in the first direction
idx2   - pattern instance index in the second direction
 DO NOT USE memb_v AND memb_i IN THE SAME RELATION
/=====================================================/


2) Concept:





3) Example








4) Relation code

4-1) Relation of  the first direction   =>It's very easy. Think  of...yourself

4-2)  The second direction => Refer to below




5) Extension, How to write the Relation code ?






2016年10月28日 星期五

[Creo VBA]Get Mass Properties

Design Automation
- Creo VBA
- Use Excel to Get Mass Properties of Model
- Excel connect to Creo

/=====================================================/
- IpfcParameters
- IpfcParameterOwner
- IpfcParameter
- IpfcBaseParameter
- IpfcParamValue
- IpfcNamedModelItem

/=====================================================/


The demo video







[Creo VBA] Get Parameter

Design Automation
- Creo VBA
- Use Excel to Get Model's Parameter and list.
- Excel connect to Creo

/=====================================================/
- IpfcParameters
- IpfcParameterOwner
- IpfcParameter
- IpfcBaseParameter
- IpfcParamValue

/=====================================================/


The demo video





[Creo API] Open Model

Design Automation
- Creo VBA
- Use Excel to Open Creo 3D Model
- Excel connect to Creo

/=====================================================/
- CCpfcModelDescriptor
- EpfcModelType.EpfcMDL_ASSEMBLY

/=====================================================/


The demo video








[Creo API] Start Creo

Design Automation
- Creo VBA
- Use Excel to Start Creo 3D software
- Excel connect to Creo

/=====================================================/
- CCpfcAsyncConnection
- AsyncConnection

/=====================================================/

The demo video









2016年3月23日 星期三

[Share] CAD 軟體市占率(2015)

CAD 軟體,因為用途、產業、使用習慣導入等,已經有越來越不一樣的趨勢,隨著個人、3D列印、創客的增加,免費一定是會增長的,看來要研究一下Free CAD了,免得改天沒工作。

約20年前,很多的軟體還要key入指令才能夠運作,現在都是圖形話介面,而未來應該是直接用說的或是思考就可以驅動CAD 繪製圖面。

專業Pro的3D CAD中還是有區分高階、中階跟低階這些的區分為何,有時候要看產業別的應用為何,在整體CAD市場中,市占率畢竟還是難敵低價、免費跟好操作的中低階軟體...

CAD是一種設計工具,可以讓工程師更簡單、更快速及更方便的在產品產出階段前去實現設計意圖,這跟設計構思的強弱沒有絕對的關係!

好用的工具用的習慣就好,來看看2015關於3D CAD 的市占率

------------------------------------------------------------
以下資料跟圖片來自blog.cnccookbook.com
(http://blog.cnccookbook.com/)
------------------------------------------------------------

Pro



Mid



Free






版權所有請勿轉載或複製
http://creosimpleautomation.blogspot.tw/

------------------------------------------------------------------------------------------------------------

2016年2月2日 星期二

[Creo Relations] Simultaneous Equations(聯立方程式)

如何用Creo Relations解Simultaneous Equations(聯立方程式)

關於Simultaneous Equations(聯立方程式)
About Simultaneous Equations 

在Relations中的Simultaneous Equations,幾個變量(參數)或尺寸必須同時解決,因此考慮到這些規則來創建聯立方程式,幾個要點:

Relations in the Simultaneous Equations, several variables (parameters) or size must be resolved, taking into account these rules to create simultaneous equations points:

  • 聯立方程式開始前,必須聲明聯立方程中使用的變量,例如,下面例子中的面積= 1000。
  • 當求解聯立方程式,系統僅返回一個組結果(即使方程式的解是多於一個以上的解)。
  • 您可以混用單變量關係的聯立方程式。

  • Before the beginning of simultaneous equations, simultaneous equations must declare the variable used, for example, following the example of area = 1000.

  • When solving the simultaneous equations, the system returns only one set of results (even if the solution is more than one equation above solution).

  • You can mix univariate relationship simultaneous equations.


一個Model最簡單的就是算面積,已知一長方體的面積跟周長,如何求出長跟寬?

A simple example, a rectangular area with the known perimeter, how long now find wide?

Parameter:
  •  Length => L
  • Width => W
Conditions:
  • The area equals 100
  • The perimeter equals 140
Equations:
  •  Area (面積) =L*W
  •  Perimeter =L*2+W*2 =(L+W)*2 
Relation:
---------------------------------------------------------------------------------------------------------------
/*Simultaneous Equations
AREA = 1000
PERIMETER = 140
SOLVE
L*W = area
2*(L+W) = PERIMETER
FOR L W
---------------------------------------------------------------------------------------------------------------

來看看,經由Relations中的Simultaneous Equations求解出來的L,W分別是多少?
From Simultaneous Equations =>   L,W?

答案是L =50 ,W=20




Tips:

  • 聯立方程式要在SOLVE and FOR 間敘述。
  • 出現在聯立方程中的任何變量(Variables),不是在FOR列表中的將被解讀為常數(Constants)。

若有仔細去計算,其實這個方程式的答案有2組 (L,W) =(50,20) & (20,50);
The answer to this equation has 2 groups (L, W) = (50,20) & (20,50);


延伸題,若是W > L,Relation程式要怎麼改寫呢?
Extend, if W> L, How to rewrite this Relation?

結果在下面,動動腦試試看!







版權所有請勿轉載或複製
http://creosimpleautomation.blogspot.tw/
------------------------------------------------------------------------------------------------------------
這Blog作為自己撰寫研究Creo Simple Automation設計自動化的分享。 

[Creo Relations] Example_2_Auto Orientation(自動定向)

如何用Relation 寫出特徵的自動定向?
Feature automatic orientation by Relation?

有些情況下,一些模型的特徵位置不是固定的,需要依據其他的條件來作為方向的定向(位置),這時候若是有規則性的就可以使用程式來自動的控制。

In some cases, the location of some of the features of the model is not fixed, it is necessary under other conditions as the orientation (position) direction, this time if there are rules of the program can be used to automatically control.

以下程式需要使用:
1. Relation => IF的判斷式
2. Parameter =>參數的定義
3. Model => 特徵的設計方法

以實例說明:Example

一個模型上會有一圓(孔)的特徵,而這孔的位置會隨著使用的條件而變動,假設圓(孔)的特徵會在Block的四邊出現(Right ,UP,Left ,Down),該怎麼來寫這個程式呢?

There will be a circle (hole) on a model feature, the location of the hole with the input conditions will change, it is assumed circle (hole) feature will appear (Right, UP, Left, Down) in the Block of four sides, How to write this program ?






1) Model => 特徵的設計方法

    請參考Model Tree

2) Parameter =>參數的定義

 L,W,H,DIA => Real number
    ORIENTATION => String
 

3) Relation => IF的判斷式

 使用IF的條件,來控制讓圓(孔)的特徵,假設要讓特徵出現在右側

  IF ORIETATION =="R"
  d10=L/2
  d11=0
  ENDIF



來看看結果吧!

<ORIETATION =="L"> 圓(孔)的特徵出現在左側 Circle (hole) features appear in the left







<ORIETATION =="D">圓(孔)的特徵出現在下側 Circle (hole) features appear on the lower side




簡單的自動化程式,若在Assembly的組件下,配合Program or Notebook(Layout)的程式,可以讓你的組件一次自動變更。

Simple automated programs.With the Program or Notebook (Layout) programs make your component,Design changes can be completed once.




版權所有請勿轉載或複製
http://creosimpleautomation.blogspot.tw/
------------------------------------------------------------------------------------------------------------
這Blog作為自己撰寫研究Creo Simple Automation設計自動化的分享。 

2016年2月1日 星期一

[Creo Relations] About Relation

前一篇,說明了Relation的應用
Previous Article illustrate the application of Relation

Creo Relation_Example_1_Auto Pattern No. (自動計算Pattern No.)


這一篇來說明一下,什麼是Relations?
This article to explain what is Relations?


關於Relations (關係式)
About Relations (relations)

關係(也稱為參量的關係)的用戶定義的方程之間寫入符號尺寸和參數。關係讓你通過定義捕捉設計意圖關係特徵或零件內,或裝配組件之一。

可以使用關係來控制建模過程通過以下方式:

  • 要控制修改對模型的影響
  • 要為零件和裝配尺寸定義值
  • 要為設計條件的約束。例如,通過在指定的孔的位置有關的部分的邊緣。
  • 為了描述一個模型或組件的不同部分之間的條件式


關係可以是簡單值(例如,D1 =4)或複雜的,有條件的,分支語句。



Relations (關係式)的使用
Relations (relation) to use

以Creo 3.0為例,開啟檔案後 >Tools>Relations,就可以打開Relations的程式編輯視窗





Relations (關係式)的基本用法 
Basic Relation Operators and Functions
- Commenting
   Use /*
- Symbols
   d#, for example
- Predefined variables
   PI, for example
- Arithmetic
   +, –, /, *, ^, ( )
- Assignment
   Equal sign “=”
- Mathematical functions
   sin (), cos (), tan (), for example
- Mass properties

Advanced Relation Operators and Functions
- Comparison operators:
   ==, <, &, !
- Conditional statements:
  IF, ENDIF, ELSE
- String functions:
 <>, itos(int), for example
- Specify the number of decimal places to ceil and floor.


Relations (關係式)的類型
Relations (relation) type

有兩種類型的關係:
等式 (算術運算)- 
方程式左邊的參數等於右邊的運算式。這種關係用於給尺寸和參數指定一值。

  • +加-減/除*乘^指數()分組括弧 例如,d0 = (d1- d2)*d3指定一值運算子
  • =等於(=) 是一個指定一值運算子,它使得兩邊的式子或關係相等。如果使用等號,方程式左邊只能有一個參數。

例如:

  • 簡單的指定一值:d1 = 3.25
  • 複雜的指定一值: d2 = d3*(SQRT(d4/5.0+d5))


~下表擷取自Proe Tutorial~




比較(對照運算) - 
比較方程式左右兩邊的運算式。這種關係通常用於作為一個限制或用於邏輯分支的條件說明中。

  • 返回 TRUE/FALSE 值時可使用對照運算子。例如,當 d1 大於或等於 3.5 時,下面的關係返回 TRUE。當 d1 小於 3.5 時,它返回 FALSE:d1 >= 3.5
  • 系統支援下列對照運算子:
           == 等於> 大於>= 大於或等於!=, <>,~= 不等於< 小於<= 小於或等於| 或& 與 ~, ! 非
           注意:「等於」指定一值運算子不同於「等於」對照運算子。
  • 運算符 號 |、&、! 和 ~ 擴展了對照關係的套用,它們使得能在單一的語句中設定若干條件。例如,當 d1 在 2 和 3 之間且不等於 2.5 時,下面關係返回 TRUE:
          d1 > 2 & d1 < 3 & d1 ~= 2.5

例如:

作為限制:(d1 + d2) > (d3 + 3.4)
在條件說明中:IF (d1 + 2.3) >= d2


~下表擷取自Proe Tutorial~



可在關係中使用下列參數類型
尺寸符號 - 支援下列尺寸符號類型:

d# - 零件或組件模式下的尺寸。
d#:# - 組件模式下的尺寸。組件或元件的作業階段標識新增為字尾。
rd# - 零件或頂層組件中的參考尺寸。
rd#:# - 組件模式中的參考尺寸。組件或元件的作業階段 ID 新增為字尾。
rsd# - 草繪器中(截面)的參考尺寸。
kd# - 在草繪器(截面)中的已知尺寸(在父零件或組件中)。
Ad# - 零件、組件或工程圖模式下的驅動連帶尺寸。
公差 - 與公差格式聯結的參數。當尺寸由數位的轉向符號的時侯出項這些符號。
tpm# - 加減對稱格式中的公差;# 是尺寸數。
tp# - 加減格式中的正公差;# 是尺寸數。
tm# - 加減格式中的負公差;# 是尺寸數。
例證數 - 某一陣列方向之例證數的整數參數。
p# - 其中 # 是例證的個數。


其他:

若有心可以找到更多的Relation function.

舉例: max(x,y) =>兩個參數來比大小,If x>y, returns x, otherwise y.


Relations (關係式)的教學查詢

1. 以前ProE會有Help/Tutorial可以查詢
     https://www.ncsu.edu/project/graphicscourse/gc/proetut/relation.html
2. 到http://learningexchange.ptc.com/線上學習
3. 使用Google查尋Creo Relations




版權所有請勿轉載或複製
http://creosimpleautomation.blogspot.tw/
------------------------------------------------------------------------------------------------------------
這Blog作為自己撰寫研究Creo Simple Automation設計自動化的分享。 



[Creo Relations] Example_1_Auto Pattern No. (自動計算Pattern No.)

在瞭解Relation的程式與用法前,先來看看Relation可以怎麼用,畢竟網路上面太多的範例都是寫用法跟寫說明,但是要怎麼用呢?如何節省你的設計變更時間呢?

Before understanding Relation programs and usage, take a look at how you can use Relation, after all, much above the network usage examples are written with instructions, but how to use it? How to save your design changes time?

以下,我舉例一個設計上面的應用例子,在設計Heatsink時難免都要用到散熱鰭片(這裡忽略不談熱傳學與公式),基本上散熱片都要有長(L)寬(W)高(H)這3個基本的參數,今天有一新的設計或是再討論散熱效率下,可能隨時都要變更長度來對應產品的需求。
結果呢?每次變更長度都要按計算機來算散熱片的數量,這樣是不是很繁瑣,而也可能還會計算錯或是輸入錯誤,因此,來看看怎麼在已知設計參數的情況下,讓Creo自動計算散熱片的數量並立即反應在模型上。

Now, I use the example of a design example above, when it is inevitable in the design Heatsink fins should be used (here ignore that science and heat transfer equations), basically fins must have length (L) Width (W) High (H) three basic parameters.
Today there is a new design or a discussed under thermal efficiency, demand may change at any time should correspond to the length of the product.
The result? The length of each change must be using a computer to calculate the number of fins, this is not very complicated, but it may also miscalculate or input errors; therefore, to see how in the known design parameters, let Creo automatic calculation of the number of fins and immediately reflected in the model.



Parameter:
1. Length  (L)   =>期望變動的設計值 Design changes in the desired value
2. Width   (W)
3. FIN_HEATSINK_PITCH
4. FIN_HEATSINK_PITCH_PAD
5. FIN_HEATSINK_SAPCE
6. NO_FIN_HEATSINK






Relation:
--------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------

Relation 說明:
1)
FIN_HEATSINK_PITCH_PAD=2
FIN_HEATSINK_SPACE=4
這定義成固定值(也可不定義由Parameter輸入),若是有變動再來調整數值即可

This is defined as a fixed value (or not defined by Parameter input), if there are changes you can adjust the values again

2) FIN_HEATSINK_PITCH定義Pattern的Pitch,由FIN_HEATSINK_PITCH_PAD & FIN_HEATSINK_SPACE計算而來

FIN_HEATSINK_PITCH defined Pattern of Pitch, calculated by FIN_HEATSINK_PITCH_PAD & FIN HEAT SINK SPACE.

3)d283 這是Pattern的起始位置,從邊開始算,一樣是FIN_HEATSINK_PITCH_PAD+FIN_HEATSINK_SPACE/2求得

d283 This is the starting position of the Pattern.
Calculated from the edge by FIN_HEATSINK_PITCH_PAD + FIN_HEATSINK_SPACE / 2 is obtained

4)NO_FIN_HEATSINK

從陣列的公式中,要計算N個陣列Total Ptich
From the formula array, to calculate the N array Total Ptich

Total Ptich=Pitch *(No-1)=FIN_HEATSINK_PITCH*(NO_FIN_HEATSINK-1)

所以,若長度是L要計算Pattern的數量,就是
Therefore, if the length is L, to calculate the number of Pattern, that is

L=(FIN_HEATSINK_PITCH_PAD+FIN_HEATSINK_SPACE/2)*2+Total Ptich

  =(FIN_HEATSINK_PITCH_PAD+FIN_HEATSINK_SPACE/2)*2+
     FIN_HEATSINK_PITCH*(NO_FIN_HEATSINK-1)

  =FIN_HEATSINK_PITCH_PAD*2+FIN_HEATSINK_SPACE+
     FIN_HEATSINK_PITCH*(NO_FIN_HEATSINK-1)

求解:
Solving:

 NO_FIN_HEATSINK=
(L-FIN_HEATSINK_PITCH_PAD*2+FIN_HEATSINK_SPACE)/FIN_HEATSINK_PITCH+1


結果:
Result:

1) 設計變更Design change  L= 355 => NO_FIN_HEATSINK=60





2) 設計變更Design change  L= 82=> NO_FIN_HEATSINK=14





由以上的說明,透過數學公式與Relation的程式,可以讓你節省下來按計算機的時間與錯誤的機會發生,而這就是透過Relation得到的最簡單的程式自動化;更深入點透過撰寫API程式,這就是一個小的二次開發插件了。

From the above description, through mathematical formulas and Relation of the program allows you the opportunity to be saved by the computer's time and the occurrence of errors, and this is through the most simple program Relation obtained automation; deeper point by writing API programs, which It is a small secondary development plug-in.

以真正的應用計算,這公式還有需要改進的地方,因為L必須跟 FIN_HEATSINK_PITCH_PAD & FIN_HEATSINK_SAPCE有關聯,動腦想想看加上一些IF判斷式與條件語句寫出自己的演算法,進而讓你的CAD動起來,而不是一步一步的手動更改設計。

In real application terms this formula there is room for improvement, since L must be associated with FIN_HEATSINK_PITCH_PAD & FIN_HEATSINK_SAPCE, brains to think with some judgment formula IF conditional statement to write their own algorithms, and then let your CAD automation, rather than manually step by step to change the design.




版權所有請勿轉載或複製
http://creosimpleautomation.blogspot.tw/
------------------------------------------------------------------------------------------------------------
這Blog作為自己撰寫研究Creo Simple Automation設計自動化的分享。