wall location line

wall location line

Anonymous
Not applicable
4,154 Views
6 Replies
Message 1 of 7

wall location line

Anonymous
Not applicable

Hi every One, 

I set wall (key_ref_para) = (2) to get the exterior point of the wall to assign it to specify point but it is not working and still modeling with the centerline of the wall .

 

//Creat First Wall
var wall1 = Wall.Create(doc,WallCollectionGenerator.Getprofile1_2(pc1,pc2),wallType.Id,LevelType.Id,true) ;
//Set Wall Location Line
Parameter Wall1LineLocation = wall1.get_Parameter(BuiltInParameter.WALL_KEY_REF_PARAM);
var wloc = Wall1LineLocation.Set(2);

0 Likes
Accepted solutions (1)
4,155 Views
6 Replies
Replies (6)
Message 2 of 7

RPTHOMAS108
Mentor
Mentor
Accepted solution

Yes, location line always is the wall centreline regardless of justification things are more predictable that way since you can work out other aspects from core layers and justification. You can check this in RevitLookup with two walls centred with one another in the east/west direction with different justifications they will have the same Y values for location line origin.  

 

Parameters are set after items are inserted so when you insert the wall and then change the justification it does not move the wall neither in the UI or the API i.e. the API needs a common insertion reference (centre line of wall).

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thank You for the reply , I got it.

0 Likes
Message 4 of 7

J450NP13
Advisor
Advisor

@RPTHOMAS108 

 

If I need a wall a certain length, if the parameter is set after it is inserted then the wall is too long.   

 

I need the exterior finish to be the dimension I am sending.

 

Right now 

 

someWall.get_Parameter(BuiltInParameter.WALL_KEY_REF_PARAM).Set(2);

 

Does not work as expected.

0 Likes
Message 5 of 7

RPTHOMAS108
Mentor
Mentor

I don't see how the behaviour is any different to the UI are you finding it is? When you change location line offset in the UI the wall itself doesn't move, is this what you see with the API?

 

I see it as more straightforward not to have to concern myself with the many locations the location line could be and the parameters I have to interrogate to find that out. I know it is the centre of the wall and I can then calculate all relationships from that via other things. 

 

The alternative is probably the nightmare you haven't yet realised, cf. structural framing and try to establish where the solid is in relation to location line by considering all the various end offset and alignment parameters for such (some of which change location line 'z end offsets' some of which don't 'global z offset').

 

Perhaps you can convince me with more of an example of how you are struggling with this. The length of the wall is always measured by centre of wall (do you want to measure it some other way, I don't understand).

 

In summary stop thinking of those blue dots as being the endpoints of the API location line in walls (and please don't ask for them to be).

 

0 Likes
Message 6 of 7

J450NP13
Advisor
Advisor

@RPTHOMAS108 

 

What’s happening is, is I’m generating walls from values I’m getting outside of Revit.  Some walls are different wall types and when I create the walls and give them their type they’re being created by the centerline....not the exterior finish that my values coming into Revit are. So they’re too long by the amount of thickness the wall is.

 

Is the solution when setting the xyz pts up divide by 2 then subtract half(walltype thickness) from length and width?

 

please don’t tell me that’s the solution.

0 Likes
Message 7 of 7

RPTHOMAS108
Mentor
Mentor

Yes you will need to calculate the positions considering the offset.

 

Try CurveLoop.CreateViaOffset method perhaps? A curve loop doesn't have to be closed.

 

Today you want the location line to be the edge of the wall for insertion tomorrow you'll want all locations lines to be consistent for reading lengths (there is no right way in that respect). Should there be a way of inserting by edge perhaps (overload with offset and normal). Should the location line position depend on a parameter? Definitely not in my view.

0 Likes