Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set dashed line in drawing vba catia

Status
Not open for further replies.

Macro2015

Automotive
Jan 19, 2015
10
SI
Hello,

I can not find how to adjust dashed line in drafting for catia. Below is some code for Linetype, but result is still filled line.

How to define a thin dashed line in vba code?

Properties_line_dashed_pgvfse.jpg


Set Line11 = Fact.CreateLine(22.5, 9.25, 192.5, 9.25)
Line11.Name = "Line11"
CATIA.ActiveDocument.Selection.Add Line11
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealLineType 4, 0.2
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealWidth 2, 0.2


Thank you for any suggestions,
 
Replies continue below

Recommended for you

Can you try on a test drawing this?

Code:
Language="VBSCRIPT"

Sub CATMain()

Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument


'-------------- select generated items

Dim selection4 As Selection
Set selection4 = drawingDocument1.Selection

selection4.Search "CATDrwSearch.CATEarlyGenItem,all"

Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealLineType 1,0.2 '-----------change line type

Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealWidth 1,0.2 '-----------change width


End Sub

Regards
Fernando

- Romania
- EU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top