Modify ImportInstance Scale Factor

Modify ImportInstance Scale Factor

dwtG8UXF
Participant Participant
1,224 Views
4 Replies
Message 1 of 5

Modify ImportInstance Scale Factor

dwtG8UXF
Participant
Participant

Hi there,

Import DWGFile to Revit ,need set  ImportUnit is Millimeter and CustomScale is 0.1, but the API can not set DWGImportOptions (CustomScale and Unit) at the same time. So then want  to modify ImportInstance's Parameter after imported, but element.get_Parameter(BuiltInParameter.IMPORT_INSTANCE_SCALE) is ReadOnly. There is anyway to modify the scale factor use API?

0 Likes
Accepted solutions (1)
1,225 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

What you are attempting to do seems strange to me, even paradoxical. Does this mean that the scale or units in the DWG file are wrong to begin with? Maybe the cleanest approach would be to scale and clean up the DWG file before importing it, and the problem will be moot? Maybe I misunderstand the intended usage of these factors, though.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor
Accepted solution

If you get the CADLinkType (ImportInstance.GetTypeId) then it's following parameters:

IMPORT_DISPLAY_UNITS

IMPORT_SCALE

 

Are both parameters whose ReadOnly state is false so can be set in the API.

 

They are two scales that can be applied independently one to ensure 1000mm long line in Autocad remains 1000mm in Revit. The other to scale that in proportion to the original (0.5 to make it 500mm long line).

 

211102.PNG

0 Likes
Message 4 of 5

dwtG8UXF
Participant
Participant

At first ,doesn't know the unit of the DWGFile  ,so need to test the right size and put onto the viewsheet. So the right way, import DwgFile with the needed unit,then change the scale. I made wrong way ,  used the wrong parameter to change. But now I understand .

Thank you for your advise .

0 Likes
Message 5 of 5

dwtG8UXF
Participant
Participant

Yes , ImportInstance must convert to CADLinkType , then can change the scale  parameter .

Thanks for your reply .

 

0 Likes