2022年8月29日星期一

NX vb

 


Option Strict Off


Imports System

Imports NXOpen

Imports NXOpen.UF

Imports NXOpenUI


Module NXJournal

Sub Main


Dim theSession As Session = Session.GetSession()

Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display

Dim ufs As UFSession = UFSession.GetUFSession()


Dim markId3 As Session.UndoMarkId

markId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Object Display")


Dim displayModification1 As DisplayModification

displayModification1 = theSession.DisplayManager.NewDisplayModification()

displayModification1.ApplyToAllFaces = False

displayModification1.ApplyToOwningParts = False

displayModification1.NewColor = 103


Dim objects1(0) As DisplayableObject

'Dim body1 As Body = CType(workPart.Bodies.FindObject("BLOCK(0)"), Body)

Dim body1 As Body = SelectSolid()

objects1(0) = body1

displayModification1.Apply(objects1)

displayModification1.Dispose()


End Sub


Function SelectSolid() As Body


    Dim ui As UI = ui.GetUI

    Dim message As String = "Select solid body"

    Dim title As String = "Selection"


    Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart

    Dim keepHighlighted As Boolean = False

    Dim includeFeatures As Boolean = True


    Dim selectionAction As Selection.SelectionAction = _

       Selection.SelectionAction.ClearAndEnableSpecific


    Dim selectionMask_array(0) As Selection.MaskTriple

    With selectionMask_array(0)

       .Type = UFConstants.UF_solid_type

       .Subtype = 0

       .SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_SOLID_BODY

    End With


    Dim selectedObject As NXObject = Nothing

    Dim cursor As Point3d


    ui.SelectionManager.SelectObject(message, title, scope, _

                                    selectionAction, includeFeatures, _

                                    keepHighlighted, selectionMask_array, _

                                    selectedObject, cursor)


    Dim solid As Body = CType(selectedObject, Body)


    If solid Is Nothing Then

       Return Nothing

    End If


    Return solid


End Function


End Module




Option Explicit On 

Imports Snap 

Module MyProgram 

Sub Main() 

Dim radius As Double = 3.75 

Dim area As Double 

area = CircleArea(radius) ' Call function to calculate area 

Dim message As String = "Area is: " 

InfoWindow.WriteLine(message & area) ' Write out the area value 

End Sub 

' Function to calculate the area of a circle 

Function CircleArea(r As Double) As Double 

Dim pi As Double = System.Math.PI 

Dim area As Double = pi * r * r 

Return area 

End Function 

End Module






Option Explicit off

Imports Snap,snap.create

Module MyProgram 

Sub Main() 



p1 = Point(5,7) ' Create a point called p1 at x=5, y=7, z=0

p2 = Point(9,2) ' Create a point called p2 at x=9, y=2, z=0

Line(p1, p2) ' Create a line between p1 and p2


End sub

End Module



Option explicit off

imports snap, snap.Create


Module SnapSample

Sub Main()

p1 = Point (5,7)

p2 = Point (9,2)

p3 = Point (15,6)

Line (p1, p2)

End sub

End Module




Option Explicit off

Imports Snap,snap.create

Module MyProgram 

Sub Main() 



p1 = Point(5,7) ' Create a point called p1 at x=5, y=7, z=0

p2 = Point(9,2) ' Create a point called p2 at x=9, y=2, z=0

Line(p1, p2) ' Create a line between p1 and p2


End sub

End Module







''''Create a cylinder

Imports System

Imports NXOpen

Module Points_01

    Sub Main()

       Dim theSession As Session = Session.GetSession()

       Dim workPart As Part = theSession.Parts.Work

       Dim lw As ListingWindow = theSession.ListingWindow

       lw.Open()

       'create Point3d using the constructor

       Dim myPt1 As New Point3d(0, 0, 0)

       'create center point

       Dim ptObj As Point

       ptObj = workPart.Points.CreatePoint(myPt1)

       ptObj.SetVisibility(SmartObject.VisibilityOption.Visible)

       Dim myVector As Vector3d

       'enter values for vector

       myVector.X = (1)

       myVector.Y = (2)

       myVector.Z = (3)

       'create offset

       Dim myOffset As Offset

       myOffset = workPart.Offsets.CreateOffset(ptObj.Coordinates, myVector, SmartObject.UpdateOption.WithinModeling)

       'create new point offset from first point

       Dim offsetPoint As Point

       offsetPoint = workPart.Points.CreatePoint(myOffset, ptObj, SmartObject.UpdateOption.WithinModeling)

       offsetPoint.RemoveParameters()

       offsetPoint.SetVisibility(SmartObject.VisibilityOption.Visible)

       lw.Close()

' Create circle

Dim curves As NXOpen.CurveCollection = workPart.Curves

Dim center As NXOpen.Point3d

center = New Point3d(-25,18,0)

Dim pi as Double =System.Math.PI

Dim twopi As Double = 2*pi

Dim length As Double = 8

Dim axisX = New Vector3d(1,0,0)

Dim axisY = New Vector3d(0,1,0)

Dim circle = workPart.curves.CreateArc(center, axisX, axisY, length, 0, twopi)

Dim ctol = 0.0095 ' Chaining tolerance

Dim dtol = 0.01 ' Distance tolerance

Dim atol = 0.5 ' Angle tolerance

'Create a circular section

Dim circ As NXOpen.Section = workPart.Sections.CreateSection(ctol, dtol, atol)

Dim helpPoint As New NXOpen.Point3d(0,0,0)

Dim nullObj As NXOpen.NXObject = Nothing

Dim noChain As Boolean = False

Dim createMode As NXOpen.Section.Mode = Section.Mode.Create

' Create rules to add the circle to the section

Dim circl As NXOpen.CurveDumbRule = workPart.ScRuleFactory.CreateRuleBaseCurveDumb({circle})

circ.AddToSection({circl}, circle, nullObj, nullObj, helpPoint, createMode, noChain)

Dim builder = workPart.Features.CreateExtrudeBuilder(Nothing)

builder.Section = circ

'Define the direction of the Extrude

Dim origin As New NXOpen.Point3d(0,0,0)

Dim axisZ As New NXOpen.Vector3d(0,0,1)

Dim updateOption = SmartObject.UpdateOption.DontUpdate

builder.Direction = workPart.Directions.CreateDirection(origin, axisZ, updateOption)

builder.Limits.StartExtend.Value.RightHandSide = "0"

builder.Limits.EndExtend.Value.RightHandSide = "50"

Dim extrudeFeature As NXOpen.Features.Extrude = builder.CommitFeature

builder.Destroy

'Get the displayable object of the Extrude feature

Dim bodies As NXOpen.Body() = extrudeFeature.GetBodies

' Change its color

bodies(0).Color = 178 ' Usually red, by default

'Show object

 bodies(0).RedisplayObject

    End Sub

End Module






Imports System

Imports NXOpen

Module NXJournal

Sub Main()

Dim theSession = NXOpen.Session.GetSession()

Dim workPart As NXOpen.Part = theSession.Parts.Work


' if nx is not in the modeling application, switch to it

If theSession.ApplicationName IsNot "UG_APP_MODELING" Then theSession.ApplicationSwitchImmediate("UG_APP_MODELING")


' create simple points (not smartpoints)

Dim p0 As New NXOpen.Point3d(1,2,3)

Dim p1 As New NXOpen.Point3d(4,7,5)


' create a line in the part

Dim line1 As NXOpen.Line = workPart.Curves.CreateLine(p0, p1)


'set the layer

line1.layer = 1


' fit to the line

workPart.ModelingViews().WorkView().Fit()


End Sub

End Module




Option Strict Off  

Imports System  

Imports NXOpen  


Module NXJournal  

Sub Main  


Dim theSession As Session = Session.GetSession()  

Dim workPart As Part = theSession.Parts.Work  


Const DatumLayer as Integer = 61  

Const CurveLayer as Integer = 256 

Const SketchLayer as Integer = 250

Const SheetLayer as Integer = 256


'move datums

for each datumObj as DisplayableObject in workPart.Datums  

if typeof(datumObj) is DatumPlane then  

datumObj.Layer = DatumLayer  

datumObj.RedisplayObject  

end if  

next  


'move curves

for each curveObj as Curve in workPart.Curves  

curveObj.Layer = CurveLayer  

curveObj.RedisplayObject  

next  


'move sketches

'do this after moving curves, sketch curves will update to sketch layer

for each sketchObj as Sketch in workPart.Sketches  

sketchObj.Activate(False)  

sketchObj.Layer = SketchLayer  

sketchObj.RedisplayObject  

sketchObj.Deactivate(False, Sketch.UpdateLevel.SketchOnly)  

next  


'move sheet bodies

for each bodyObj as Body in workPart.Bodies  

if bodyObj.IsSheetBody then  

bodyObj.Layer = SheetLayer  

bodyObj.RedisplayObject  

end if  

next  


End Sub  

End Module 


Option Strict Off
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.Utilities
Module move_solid_bodies_to_new_layer
 Dim s As Session = Session.GetSession()
 Sub Main()
 Dim workPart As Part = s.Parts.Work
 Dim bodies As BodyCollection = workPart.Bodies
 Dim solid_bodies(-1) As Body
 Dim counter As Integer = 0
 Dim newLayer As Integer = 100
 Dim bodyCount As Integer = bodies.ToArray.Length
 MsgBox("All Bodies in Work Part: " & bodyCount.ToString())
 newLayer = NXInputBox.GetInputNumber("Destination Layer Number", “Destination Layer number”, newLayer.ToString)

 If bodyCount > 0 Then
 For Each thisBody As Body In bodies
 If thisBody.IsSolidBody.Equals(True) Then
 ReDim Preserve solid_bodies(counter)
 solid_bodies(counter) = thisBody
  ' Change its color
solid_bodies(counter).Color = 178 ' Usually red, by default
'Show object
 solid_bodies(counter).RedisplayObject
counter += 1
 
 End If
 Next
  
 workPart.Layers.MoveDisplayableObjects(newLayer, solid_bodies)
 Dim solidBodyCount As Integer = solid_bodies.Length()
 MsgBox(solidBodyCount.ToString() & "Solid Bodies moved to layer: " & newLayer.ToString)
 

 End If
 End Sub
 Public Function GetUnloadOption(ByVal dummy As String) As Integer
 Return Session.LibraryUnloadOption.Immediately
 End Function
End Module

Option Strict Off

Imports NXOpen

Imports NXOpenUI

Imports NXOpen.Utilities

Module move_solid_bodies_to_new_layer

 Dim s As Session = Session.GetSession()

 Sub Main()

 Dim workPart As Part = s.Parts.Work

 Dim bodies As BodyCollection = workPart.Bodies

 Dim solid_bodies(-1) As Body

 Dim counter As Integer = 0

 Dim newLayer As Integer = 100

 Dim bodyCount As Integer = bodies.ToArray.Length

 MsgBox("All Bodies in Work Part: " & bodyCount.ToString())

 newLayer = NXInputBox.GetInputNumber("Destination Layer Number", “Destination Layer number”, newLayer.ToString)


 If bodyCount > 0 Then

 For Each thisBody As Body In bodies

 If thisBody.IsSolidBody.Equals(True) Then

 ReDim Preserve solid_bodies(counter)

 solid_bodies(counter) = thisBody

  ' Change its color

solid_bodies(counter).Color = 178 ' Usually red, by default

'Show object

 solid_bodies(counter).RedisplayObject

counter += 1

 

 End If

 Next

  

 workPart.Layers.MoveDisplayableObjects(newLayer, solid_bodies)

 Dim solidBodyCount As Integer = solid_bodies.Length()

 MsgBox(solidBodyCount.ToString() & "Solid Bodies moved to layer: " & newLayer.ToString)

 


 End If

 End Sub

 Public Function GetUnloadOption(ByVal dummy As String) As Integer

 Return Session.LibraryUnloadOption.Immediately

 End Function

End Module





Option Strict Off

Imports System

Imports NXOpen

Imports NXOpen.UF

Imports NXOpen.UI

Imports NXOpen.Utilities

Imports NXOpen.Features

Module report_journal_identifiers

Dim theSession As Session = Session.GetSession()

Dim theUFSession As UFSession = UFSession.GetUFSession()

Sub Main()

Dim dp As Part = theSession.Parts.Display

Dim theBodies() As Body = dp.Bodies.ToArray()

Dim theFeatures() As Feature = dp.Features.ToArray()

Echo("Journal Identifiers for the Body objects:")

For Each thisBody As Body In theBodies

Echo(thisBody.JournalIdentifier())

Next

Echo("=========================================")

Echo("Journal Identifiers for the Feature objects:")

For Each thisFeat As Feature In theFeatures

Echo(thisFeat.JournalIdentifier())

Next

End Sub

Sub Echo(ByVal output As String)

theSession.ListingWindow.Open()

theSession.ListingWindow.WriteLine(output)

theSession.LogFile.WriteLine(output)

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

Return Session.LibraryUnloadOption.Immediately

End Function

End Module




Option Strict Off

Imports System

Imports NXOpen

Imports NXOpen.UF

Imports NXOpen.Features

Module LayerProgramming3

Sub Main()

Dim s As Session = Session.GetSession()

Dim ui As UI = ui.GetUI()

Dim ufs As UFSession = UFSession.GetUFSession()

Dim lw As ListingWindow = s.ListingWindow

lw.Open()

' We look only at the current work part

Dim workPart As Part = s.Parts.Work

' Get all objects on the work layer

Dim objs() As NXObject = workPart.Layers.GetAllObjectsOnLayer(workPart.Layers.WorkLayer)

lw.WriteLine(objs.Length.ToString & " objects on layer: " & workPart.Layers.WorkLayer.ToString)

' Now list all the objects

For Each b As NXObject In objs

lw.WriteLine(b.ToString)

Next

lw.WriteLine(vbCrLf)

' Another listing for each body in the work part we can list the features and the body layer

For Each abody As Body In workPart.Bodies

For Each afeat As Feature In abody.GetFeatures

lw.WriteLine(afeat.GetFeatureName & " on layer : " & abody.Layer.ToString)

Next

Next

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX

GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module

Option Strict Off  
Imports System  
Imports NXOpen  

Module NXJournal  
Sub Main  

Dim theSession As Session = Session.GetSession()  
Dim workPart As Part = theSession.Parts.Work  

Const DatumLayer as Integer = 61  
Const CurveLayer as Integer = 256 
Const SketchLayer as Integer = 250
Const SheetLayer as Integer = 256

'move datums
for each datumObj as DisplayableObject in workPart.Datums  
if typeof(datumObj) is DatumPlane then  
datumObj.Layer = DatumLayer  
datumObj.RedisplayObject  
end if  
next  

'move curves
for each curveObj as Curve in workPart.Curves  
curveObj.Layer = CurveLayer  
curveObj.RedisplayObject  
next  

'move sketches
'do this after moving curves, sketch curves will update to sketch layer
for each sketchObj as Sketch in workPart.Sketches  
sketchObj.Activate(False)  
sketchObj.Layer = SketchLayer  
sketchObj.RedisplayObject  
sketchObj.Deactivate(False, Sketch.UpdateLevel.SketchOnly)  
next  

'move sheet bodies
for each bodyObj as Body in workPart.Bodies  
if bodyObj.IsSheetBody then  
bodyObj.Layer = SheetLayer  
bodyObj.RedisplayObject  
end if  
next  

End Sub  
End Module 



 





2022年8月7日星期日

Pokok Sarsi.

 

Khazanah hutan : Pokok Sarsi.

Pokok Sarsi.

Pokok Sarsi merupakan antara pokok hutan yang unik, kerana baunya.
Baunya sama seperti air Sarsi yang biasa kita minum tu.
Dari daun, batang serta akar, semuanya mempunyai bau Sarsi.
Paling kuat baunya adalah pada bahagian akar.
Kalau gantung akar Sarsi ni kat beg, orang belakang sampai boleh bau, punya la kuat.

Menurut pembacaan aku yang sedikit ni, pokok Sarsi mempunyai khasiat tertentu, antaranya melancarkan aliran darah & mengembalikan tenaga.

Pokok Sarsi ni boleh mencapai tahap pokok balak.
Maknanya memang besar gedabak la.

Air rebusan akar Sarsi ni boleh diminum.
Kalau nak sedap lagi, tambah gula, memang sebijik rasa macam air sarsi.
Cumanya aku tak pasti air sarsi kat kedai tu dibuat dari pokok Sarsi ni ke tak..

Pokok Sarsi.

Daun pokok Sarsi.

Akar pokok Sarsi.

Aromanya.., fuuuuhhhhh..
Memang wangi..!

Kalau bukak penutup cerek, fuuhh.., baunya lagi menusuk kalbu, hehe..

Biasanya minum air sarsi ais.
Rupa2nya minum panas2 lagi syok, hehe...

Tuang dalam botol skit, untuk simpan dalam peti ais.

Serpihan kayu Sarsi bersaiz balak, dijadikan sebagai alas pemotong.


Ni lah kayu alas pemotong yang selalu guna kat kebun.
Masa tu tak tau ni kayu Sarsi.
Dah setahun lebih guna, baru aku tau tu kayu Sarsi rupanya2, huhuhu...
Kayu tu dah terbiar lama, berhujan panas selama beberapa tahun.
Tapi bila potong sikit kayu tu, bau Sarsi tetap kuat..!


Lagi gambar2 kayu sarsi:





2022年8月3日星期三

creo工程图转化DWG配置设置方法

 

[creo]creo工程图转化DWG配置设置方法

 漆書壁經 2020-07-11   |  2418阅读  |  19转藏
转藏全屏朗读分享

在上次分享中介绍过creo工程图转化DWG的图层映射方法,有读者希望不要每次转化都要设置一遍,本期就继续为大家介绍相关配置的方法

1.config.pro的设置

intf_out_layer 值为part_layer

输出到 dwg/dxf 文件时系统将图元详细分类自动产生不同的图层并自动命名

dxf_export_mapping_file D:creoDxf_export.pro

高版本该选项已调整为intf2d_out_dxf_mapping_file(读者朋友可以自己验证一下,当上述选项配置报错时即表示不支持,可改用此选项)

2.Dxf_export.pro的设置

可以自定义图层名称、线条颜色、线型等,不再受creo默认

语法有三种:

自定义图层名称:map_layer ( 默认图层名称 ) ( 自定义名称 )

自定义线条颜色:map_color (creo系统颜色 ) (AutoCAD 系统颜色 )

自定义线型: map_line_style (creo线型名称 ) (AutoCAD系统线型名称 )

2.1 图层

creo默认图层名称:

(part_name)_Dxf_Axis 所有轴线

(part_name)_Dxf_Continuous_Line 连续线

(part_name)_Dxf_Hidden_Line 隐藏线

(part_name)_Dxf_Dimension 尺寸标注

(part_name)_Dxf_Text 文本批注

(part_name)_Dxf_Hatching 剖面线

(part_name)_Dxf_Table 表格

(part_name)_Dxf_Ballon 球标符号

(part_name)_Dxf_Format 图框

示例:

map_layer Dxf_Dimension Dim

!尺寸

map_layer Dxf_Axis Axis

!轴

map_layer Dxf_Hatching Hatch

!剖面线

map_layer Dxf_Text Text

!文本

map_layer Dxf_Table Table

!表格

map_layer Dxf_Hidden_line Hid

!隐藏线

map_layer Dxf_Format Format

!图框

map_layer Dxf_Continuous_Line Solidline

!实线

2.2 线条颜色

creo系统颜色

CREO颜色名称

Creo默认颜色

AutoCAD颜色

LETTER_COLOR

黄色

2

HIGHLIGHT_COLOR

红色

1

GEOMETRY_COLOR

白色

7

DIMMED_MENU_COLOR

浅灰

9

EDGE_HIGHLIGHT_COLOR

蓝色

140

HIDDEN_COLOR

深灰色

8

VOLUME_COLOR

洋红色

6

SECTION_COLOR

青色

4

SHEETMETAL_COLOR

绿色

3

CURVE_COLOR

褐色

40

BACKGROUND_COLOR

深蓝色

5

AutoCAD 系统的颜色是用数字作名称,读者朋友们可以打开AutoCAD查看

系统颜色

名称

红色

1

黄色

2

绿色

3

青色

4

深蓝色

5

洋红色

6

白色

7

深灰色

8

浅灰色

9

示例:

map_color LETTER_COLOR 2

!黄色

map_color HIGHLIGHT_COLOR 1

!红色

map_color GEOMETRY_COLOR 7

!白色

map_color DIMMED_MENU_COLOR 2

!黄色

map_color EDGE_HIGHLIGHT_COLOR 7

!白色

map_color HIDDEN_COLOR 8

!深灰色

map_color VOLUME_COLOR 206

!紫红色

map_color SECTION_COLOR 5

!深蓝色

map_color SHEETMETAL_COLOR 7

!白色

map_color CURVE_COLOR 7

!白色

map_color SKETCH_COLOR 4

!青色

map_color DATUM_COLOR 36

!深褐色

map_color QUILT_COLOR 6

!洋红色

map_color HIDDEN_LINE_COLOR 8

!深灰色

map_color BACKGROUND_COLOR 250

!黑色

2.3 线型

creo系统线型名称:

隐藏线 Hidden

实线 Geometry

导引线 Leader

虚线 Phantom

中心线 Centerline

AutoCAD 系统的线条样式:

实线 Solidline

虚线 Dashed

中心线 Center

点画线 Dashdot

双点画线 Divide

点线 dot

示例:

!线型设置配置文件

map_line_style Phantom Dashed

!虚线

map_line_style Hidden Dashed

!隐藏线

map_line_style Geometry Solidline

!实线

map_line_style Centerline Dashdot

!中心线

map_line_style Leader Solidline

!导引线

作者介绍

支持原创,可以点击下面的喜欢作者

How to set up line thickness for drawings in Creo 6.0

 

How to set up line thickness for drawings in Creo 6.0? | Pen Tables

Drafting in Creo 6.0 is sometimes quite frustrating as it should not be since Creo is one the best CAD for engineers who work with large assemblies and also a wide variety of families of products with different sizes and varieties. Setting line thickness for drawings in creo is a myth for some people.

For people who are new to Creo, PTC Creo is a family or suite of CAD software, that supports product design for discrete manufacturers and is developed by PTC.

As I have mentioned during our Drafting work, we face many challenges. As I work through many features of Creo, One of my co-workers asked me how to change the line thickness for drawings in the latest Creo 6.0. Let us discuss How to set up line thickness for drawings in Creo 6.0.

Setting Line Thickness For Drawings in Creo 6.0

First of all, the setting will be the same as the older version with the current version of Creo 6.0

There will be two-aspect when you face this issue.

  • While exporting a DWG/DXF file format to use in other CAD software such as AutoCAD
  • While Exporting a PDF file to print on an A3 or A2 sheet (Pen Table Settings)

We will discuss these two areas deeply.

Setting Line Thickness for Exporting a DWG/DXF file

  • Creo Parametric does not assign line width in drawing, especially for models displayed in views.
  • Those lines are only assigned different system colours depending on their types (Geometry, Hidden Lines, Quilts, etc). They can be changed in the System Appearance section of the Options menu.
set up line thickness for drawings in Creo 6.0
  • Therefore the thickness is not transferred when exporting to DWG / DXF file formats unless explicitly setting a style and width on each item.
  • However other information can be mapped during the export, like Colors, Layers or Fonts in the Export Setup > Settings > Properties dialogue for the latest Creo releases.
set up line thickness for drawings in Creo 6.0
  • The default values can be specified in a dxf_export.profile
  • An sample file will be available under <Creo Installation directory>\Common Files\text\intf_configs folder
set up line thickness for drawings in Creo 6.0
  • The file location can be defined in the Data Exchange section of the Options menu and/or through the config.pro option intf2d_out_dxf_mapping_file
set up line thickness for drawings in Creo 6.0
  • Then, even if not allowed to directly show the thickness in the Graphic Area of the application itself, when the file is opened in Autocad the colours may be used to print with the proper line weight through Plot Style Tables:
    • You can try troubleshooting techniques in the Autodesk article source to get the colours and line weight correctly imported.
    • You could also explore ways to place the imported entities on Layers (for example selecting by colour) and define the line weight in their properties side the AutoCAD itself the other CAD software which they must provide.
  • In Creo Parametric, as indicated above, an alternative could be:
    • Use the Layout > Line Style command and assign a line font and width to each drawing entity
set up line thickness for drawings in Creo 6.0
  • Ensure the config.pro option intf2d_out_line_width is set to yes.
option intf2d_out_line_width is set to yes
  • Or convert the drawing view to draft entities to enable selection by rules to edit multiple items at once and manually modify the line thickness and colours.
convert the drawing view to draft entities in creo

PDF Export and Line Thickness:

When exporting to PDF, like plotting, it is possible to use a Pen Table and control the thickness for each system colour assigned to a pen.

Pen table is nothing but a text file you create with attributes to override the system attributes. so this file can be created in the notepad in the windows operating system or any text editor of your choice.

  1. To Create a Pen Table File Open a text editor. (Save the file with the extension .pnt. For example, table.pnt or <filename>.pnt. The filename should be lowercase.)
  2. In order to change the existing pen table system attributes, assign your own line font, thickness, or colour to a pen using the table.pnt file. Any attribute that you specify overwrites the default instructions.
  3. The format for an entry in the table.pnt file is as follows:
pen # pattern values units; thickness value units; color values; <color_name>
  1. Description of these attributes are as follows
    • pattern—Specifies plotted line font definition drawn according to defined values in the given units. Values are created in the following order: first-line segment length, first space length, second-line segment length, second space length, and so on. For example: pen 3 pattern .1 .05 .025.05.
    • thickness—Specifies plotted line thickness in the given units.
    • colour—Specifies colour used for plotting; defines colour using proportions of red, green, and blue on a scale of 0 to 1. Works only on colour plotters.
    • <color_name>—Corresponds to the default Creo Parametric colour that the system assigns to a particular entity type (to access the default system colours, click File > Options > System Colors, and then, in the System Colors tab, select Default from the Color scheme list.
    • The following table lists the details of pen #
Pen #System ColorMapping
1GeometryCurveManufacturing volumeQuiltPreselection highlightPreview geometrySecondary preview geometryVisible geometry (plot as solid lines, except where noted): Cross-section cutting plane lines: plot as phantom lines cross-section cutting plane arrows and text drawing format and boundary tag next centerline line font with white color
2Letter DatumAll items plot as solid lines (except where noted): Dimension linesLeadersAxes and centerlines: plot as centerlinesGeometric tolerance linesAll text (except cross-section text)Balloon notes cross-hatchingCenterline line font with a yellow colour brown portion of datum planes
3Hidden LineHidden lines: plot as dashed lines, phantom font
4Primary highlightSelectedSecondary selectedAll items plot as solid lines: Spline surface grid (does not plot in drawings)
5Sheet metalSheet metal colour entities
6Sketched CurveSketcher section entities
7Secondary highlightToggled sections, greyed dimensions and text, dimmed tangent edgesDark grey portion of datum planes
8Edge highlightSpline surface grid
Source: PTC Creo Website
  1. by default, Creo Parametric uses a pen table file table.pnt in the working directory. If table.pnt is not found in the working directory, then Creo Parametric looks for the file in <creo_loadpoint>/common_files/<datecode>/text/table.pnt.

General Guidelines to keep in mind while writing pen tables for Creo

  • More than 8 pens can be supported.
  • All units must be set in inches (IN) or centimetres (CM). Using millimetres (MM) results in a syntax error.
  • It is possible to assign more than one colour to the same pen in the table.pnt file.
  • Separate multiple colour names by spaces or commas.
  • Separate attributes by semicolons.
  • Include any or all attributes for each pen.
  • Attributes that were not included in the table.pnt file appears unchanged, as in normal plotting.
  • Use units in inches (in) or centimetres (cm), and mix them in font definitions; for example, you can specify a font pattern in inches and thickness in centimetres.
  • Use the backslash (\) at the end of a line to continue the entry on the next line.
  • Use an exclamation point (!) at the beginning of a line in the file to make it a comment.

Example Pen Table

pen table example

Let us know if this helps you set the line thickness of the drawing you are working…