Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LinePattern definition from GraphicsStyle

5 REPLIES 5
Reply
Message 1 of 6
homer_anave
996 Views, 5 Replies

LinePattern definition from GraphicsStyle

A straightforward title...but is this possible?

 

The remarks section of the LinePattern class in the Revit API Help says LinePatterns are used in the definition of GraphicsStyle object. But it seems that I can't find a way to acquire the LinePattern from a GraphicsStyle object.

5 REPLIES 5
Message 2 of 6

Hello,

 

I have enquired with the engineering team about this. I will get back to you as soon as I have some relevant information.

 

Thanks

Gopinath

Message 3 of 6

Hello,

 

I am discussing this with my colleagues and the question came up as to what you want to do exactly. Do you have a use case on what you want to achive?

 

Thanks

Gopinath

Message 4 of 6
homer_anave
in reply to: homer_anave

One case is, we are trying to change a line pattern of an object that was imported from AutoCAD to a line pattern that is already defined in Revit.

 

To be more specific, linetypes of layers (that become GraphicsStyle objects) that are imported from AutoCAD are created anew in Revit. Even though linetype names in AutoCAD and line patterns in Revit shares the same name, Revit seems to ignore this and instead creates unique line patterns based on it. Since this is the case, we decided to change the imported linetypes (that became line patterns in Revit) of each converted GraphicsStyles to their proper equivalent line patterns programmatically with Revit API. But since we cannot find an API to change line patterns of GraphicsStyles, we are stuck and can't move further.

Message 5 of 6

Hello,

 

It looks like there is no real API connecting GraphicsStyle to LinePattern. Apologies for the misleading documentation. One of my colleagues provided this info for creation of a line Pattern:

 

*---------

developers can create new line pattern element in Revit 2014.

Using the below constructor to create a LinePattern object.

LinePattern(String)

 

Then call LinePattern.SetSegment() method to create customized line pattern.

Finally using the LinePattern object to create the LinePatternElement via LinePatternElement.Create(LinePattern)

*---------

 

Also this sample shows how the LinePatternElement can be set to an object (as a property): <RevitSDK2014>\Samples\CreateFillPattern\CS

 

Hope this helps.

 

Thanks

Gopinath

 

 

Message 6 of 6
yymt168
in reply to: homer_anave

Different view can have different display LinePattern in same element.

so I guess the 

View.ProjLinePatternOverrideByElement Property is away to acquire LinePattern.

C#

public LinePatternElement this[
	ICollection<ElementId> ids
] { get; set; }

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community