Create.NewDimension not working as expected

Create.NewDimension not working as expected

ThomasPalme
Explorer Explorer
494 Views
1 Reply
Message 1 of 2

Create.NewDimension not working as expected

ThomasPalme
Explorer
Explorer

Hello guys!

 

While working with the Revit API & Dimensions, i hit a roadblock,

 

I am trying to create the same dimension again:

Before.jpg

As you can see, left and rightmost dimension references are in a linked model, and the middle 4 references are in this model.

These are their stable representations:

"79b0def4-4c3e-4236-bed1-f5882e1169b7-00ef95e0:0:RVTLINK:628051:0:INSTANCE:627289:14459:INSTANCE:896150:7:6:LINEAR/7"
"05b4b29d-8b32-41be-81a6-b4e76080906b-00a1bbe1:0:LINEAR/1"
"5a542d19-7a69-4dc7-bec8-c48efb3773c9-00ab89f2:0:LINEAR/0"
"5a542d19-7a69-4dc7-bec8-c48efb3773c9-00ab89fa:0:LINEAR/0"
"05b4b29d-8b32-41be-81a6-b4e76080906b-00a1be8a:0:LINEAR/0"
"79b0def4-4c3e-4236-bed1-f5882e1169b7-00ef95e0:0:RVTLINK:628051:0:INSTANCE:627289:14459:INSTANCE:896150:7:6:LINEAR/3"

 

I use the following code:

 

 

using var line = dim.Curve as Line;
doc.Create.NewDimension(dim.View, line, dim.References, dim.DimensionType);

doc.Delete(dim.Id);

 

 

 

What i get is this:

After.jpg

 

How come this does not work? Hope somebody can help me 🙂

 

Greetings from Vienna!

0 Likes
495 Views
1 Reply
Reply (1)
Message 2 of 2

CJModis
Advocate
Advocate

Try to get stable representation strings from references of current dimension and for new dimension create new references from that strings via ParseFromStableRepresentation Method

0 Likes