Change 'Line Style' for Reference component in Drawing View using API

Change 'Line Style' for Reference component in Drawing View using API

waynehelley
Collaborator Collaborator
1,362 Views
2 Replies
Message 1 of 3

Change 'Line Style' for Reference component in Drawing View using API

waynehelley
Collaborator
Collaborator

Hi all,

 

Is it possible to toggle the 'Line Style' in a Drawing view through the API??

 

I can happily set the view rep, LOD, DrawingViewStyleEnum, etc. but I can find anything for the line style of reference components.

 

I need to be able to do this because I have a script which exports DXFs for cutting.  The layer names need to be specified but dashed lines seem to get exported automatically as 'Reference (ISO)'

 

(worst case scenario I can make it so that my script temporarily change the BOM structure of the component in question)

 

Thanks,

 

Wayne

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
1,363 Views
2 Replies
Replies (2)
Message 2 of 3

BrandonBG
Collaborator
Collaborator

In the API help, search for "Drawing Sketches - editing line type and color API Sample".

 

I believe if you can identify the reference part inside the DrawingView, you can set the LineType and LineWeight.

 

Brandon

0 Likes
Message 3 of 3

frederic.vandenplas
Collaborator
Collaborator

@waynehelley Why don't you customise your dwt file?

Add a layer with reference (ISO) with correct properties and postprocess your export.

I've done this many times and seems to work relatively good.

 

This is my ini file (you need to change your path (2x)

[EXPORT SELECT OPTIONS]
AUTOCAD VERSION=AutoCAD 2010
CREATE AUTOCAD MECHANICAL=No
USE TRANSMITTAL=No
USE CUSTOMIZE=Yes
CUSTOMIZE FILE=Path to this file \ExportIDW2DWG.xml
CREATE LAYER GROUP=No
PARTS ONLY=No
REPLACE SPLINE=No
CHORD TOLERANCE=0,001000
[EXPORT PROPERTIES]
SELECTED PROPERTIES=
[EXPORT DESTINATION]
SPACE=Model
SCALING=Geometry
ALL SHEETS=Yes
MAPPING=LooksBest
MODEL GEOMETRY ONLY=No
EXPLODE DIMENSIONS=No
SYMBOLS ARE BLOCKED=Yes
AUTOCAD TEMPLATE=Path to your template.dwt
DESTINATION DXF=No
USE ACI FOR ENTITIES AND LAYERS=Yes
[EXPORT LINE TYPE & LINE SCALE]
LINE TYPE FILE=C:\Users\Public\Documents\Autodesk\Inventor 2015\Compatibility\Support\acadiso.lin
Continuous=Continuous;0,
Dashed=DASHED;0,
Dashed Space=Continuous;0,
Long Dash Dotted=Continuous;0,
Long Dash Double Dot=Continuous;0,
Long Dash Triple Dot=Continuous;0,
Dotted=Continuous;0,
Chain=Continuous;0,
Double Dash Chain=Continuous;0,
Dash Double Dot=Continuous;0,
Dash Dot=Continuous;0,
Double Dash Dot=Continuous;0,
Double Dash Double Dot=Continuous;0,
Dash Triple Dot=Continuous;0,
Double Dash Triple Dot=Continuous;0,

And attached  my postprocess file that is referenced in the ini file

 

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes