Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following code should draw a 1 cm width line:
Public Sub MyLine() Dim clientId As String clientId = "{2E2EA04D-C12D-4280-BAE3-8ED9DC7DFFA0}" Dim graphics As ClientGraphics On Error Resume Next ThisDocument.ComponentDefinition.ClientGraphicsCollection(clientId).Delete On Error GoTo 0 Set graphics = ThisDocument.ComponentDefinition.ClientGraphicsCollection.Add(clientId) Dim node As GraphicsNode Set node = graphics.AddNode(1) On Error Resume Next ThisDocument.GraphicsDataSetsCollection(clientId).Delete On Error GoTo 0 Dim dataSets As GraphicsDataSets Set dataSets = ThisDocument.GraphicsDataSetsCollection.Add(clientId) Dim coordSet As GraphicsCoordinateSet Set coordSet = dataSets.CreateCoordinateSet(1) Dim coords(5) As Double coords(0) = 0: coords(1) = 0: coords(2) = 0: coords(3) = 1: coords(4) = 1: coords(5) = 1 coordSet.PutCoordinates coords Dim lineGraphPrimitive As LineGraphics Set lineGraphPrimitive = node.AddLineGraphics() lineGraphPrimitive.LineWeight = 1 lineGraphPrimitive.LineDefinitionSpace = kModelSpace lineGraphPrimitive.CoordinateSet = coordSet ThisDocument.Views(1).Update End Sub
But the LineWeight is not taken in account. In fact, even with LineDefinitionSpace at kScreenSpace, the line weight does not always match the value set. It seems that the line weight is capped to 4 px.
Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Solved! Go to Solution.