Hi,
Im trying to list all links in a document using filteredelementcollectors..
I get the RVT links (revit and ifc), throug the BuiltInCategory,
DWG links also works fine using the "ofClass(typeof(importInstance)" filter.
I thought that DWFx and pointclouds also should be listed under this filter?
It seems not to.. I can't get them through that filter, and I can't see any other type to use (by google or api documentation)
Anyone have any tips?
Are DWFx markups an own class? category ??
tnx
Daniel
Dear Daniel,
Can you please attach a sample file with just one or two links and almost no other content, and tell us exactly what results you would expect to see?
Please include everything required to load the file with no warnings, detached from central, all support files included, etc.
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Thank you!
Cheers,
Jeremy
Hi,
I am creating a smal buildable sample now, will send it as soon as possible.
Daniel
Hi,
While working on the small sample, I found the error.
It's kind of simple. DWFx does not get linked, even though they appear to be so.
When I changed from:
var dwgLinks = fecDwgLinks.OfClass(typeof(ImportInstance)).ToElements().Cast<ImportInstance>().Where(f=> f.IsLinked);
to
var dwgLinks = fecDwgLinks.OfClass(typeof(ImportInstance)).ToElements().Cast<ImportInstance>();
Things worked fine.
I have not tried it on pointClouds, but I guess it will work just fine.
\Daniel
Dear Daniel,
Congratulations on solving it, and many thanks for letting us know!
You cannot imagine how often problems get resolved by attempting to create a minimal reproducible sample.
Could you please post the entire filtered element collector implementation to retrieve the DWF links?
Surely just asking for typeof(ImportInstance) will return other links as well?
Please also let us know how it goes with the point clouds.
Thank you!
Cheers,
Jeremy
It does return other links aswell, but that is how I want it.
I am creating a tool, which lists all the links.
When I use the collected elements, I just use the category name, which contains the extension name.
var namearray = importlink.Category.Name.Split('.');
var name = namearray.FirstOrDefault();
var extension = string.Empty;
if (namearray.LastOrDefault() != null)
extension = namearray.Last();
then I have created an Enum, wich i group a list on..
GroupingEnum lType = GroupingEnum.Unknown;
if (extension.ToLower().Contains("dwg"))
lType = GroupingEnum.Dwg;
else if (extension.ToLower().Contains("dwf"))
lType = GroupingEnum.Dwf;
this is used to group a list, so that it is easy to chose the wanted elements.
Daniel
Muy maja, Daniel!
I summarised the result here:
Cheers,
Jeremy