How to get geometry information of a single wall? - c#

I want to retrieve geometry information from a single wall in IFC file.
I have tried it using Xbim. I have learned that XbimModel.GetGeometryData Method (IfcProduct, XbimGeometryType) could be used to obtain information of a single ifc element.But this method seems to be obsoleted now. My question is how to get geometry information,say,the vertex coordination of a single ifc wall?

There are diffrent ways to get the Informations. In generall you ned to get the selected IFC Element. If you got that you are able to read all the informations you want.
If use for example XbimWebUI you can get all your infos from the viewer.

Related

Storing Math.Numerics.Fit.Line data into two separate variables simultaneously

I am working on a excercise here which is gathering data from a file and then displaying it on graph.
I am using a linkedIn video to help me here but I stumped on how they are able to store this extension method into two separate variables at the same time.
var (intersect,slope) = MathNet.Numerics.Fit.Line(arrx.ToArray(), arry.ToArray());
If I keep one variable on the left side the red lines go away but if I keep both "intersect" and "slope", it gives me an error.

Get Facebook user's details and big profile picture in one call

I can get in one call /me details including picture, email, name.
But URL returned is of an extremely small picture (50px*50px).
I know I can make additional call to get bigger image with something like:
.../me/picture?width=999
But is it possible to combine it with:
https://graph.facebook.com/v2.5/me?fields=id,relationship_status,picture,email,gender,first_name,last_name,significant_other
to receive all this information in one request-response instead of two?
Here you go:
https://graph.facebook.com/v2.6/me?fields=id,relationship_status,picture.width(999),email,gender,first_name,last_name,significant_other
You can make nested requests by following this:
https://developers.facebook.com/docs/graph-api/using-graph-api#fieldexpansion

Best approach of doing full outer join on parse.com with Xamarin.Android (c#)

I have this common scenario of displaying comments with user details and I'm trying to figure out the best way to do this on Parse.
(Let's say we have a class comment: id, post, user and a class user: id, photo, name).
I was trying to do something like this that it isn't possible on Parse:
var userDetails = ParseObject.GetQuery("User");
var query = ParseObject.GetQuery ("Review")
.WhereEqualTo ("business", application.currentBusiness)
.WhereMatchesQuery ("user", userDetails);
It is not working because users is a Relation, let me explain more:
From what I have read on documentation there are 2 ways to have relations in parse. one with arrays and one with pointers.
Arrays are good when you want to include the whole object (in my case the user) but not for more than 100 results.
Pointers are better for a big database but in order to get for every comment the user details I will have to do one extra query.. that's a lot of queries...
So my options are those I think:
1) Retrieve the whole query with a full outer join with arrays
The problem with this is the speed if my app is getting bigger and bigger
2) Retrieve the whole query with a full outer join with relations
Many many queries. I will reach the parse.com limit of request/sec very fast.
3) Store the details I want in the comments class along the User_ID
This might be a good idea but I'm using Login with Facebook and after the login, the user photos will be updated if it has change since the last time, so if I want to use this idea I have to somehow disable the update of the photo.
4) Use arrays and retrieve only a certain number of comments each time.
This sounds like the best approach, I will get every time around 50 seconds and I can implement a ListView that will load more comments when we are reaching the end of the List.
What do you think guys? What do I have to do? Am I missing something here?
The best solution after all was to use Pointer for the User.
With the pointer and the .Include you can get the whole user object without doing many queries and without destroying the connection of the User class with the comments class by storing the whole User object on the Comment class, nice.
Also if someone want to know how to make a join with pointers and how to retrieve the object then here is q query to retrieve comment and photo:
var query = ParseObject.GetQuery ("Comments")
.WhereEqualTo ("Article", _article)
.Include ("user");
And here is how to access the photo
_user.photo = queryResult.Get<ParseObject>("user").Get<ParseFile>("profile_pic").Url;

How to move through different records in C#

I made a form that basically displays information about different vendors from an XML file that I was given. The XML file is retrieved from a class that I created, called VendorsDB.cs. On my form, I have a Previous and Next button that I want to display the next vendor or the previous vendor (Vendor1, Vendor2...) but I have no idea what method to use. I know I have to use a loop but I'm not sure as to how to code the loop. I've just started programming with C# so I'm really lost. Any help would be greatly appreciated!
Your question is missing alot of information, but what im seeing is that you need to do some work with XML.
I suggest you look into Linq To XML which enabled you to query tags and attributes with query syntax.
A very simple query good look like this:
// Load the xml from the specified path
var xml = XDocument.Load(#"LocationOfXml");
// Query the first element with a "MyXmlTag" as name
var someAttribute = xml.Descendants().FirstOrDefault(x => x.Name == "MyXmlTag");
The query language is far richer than this simple query. Read up and im sure you'll be able to get it working asap.

How to combine 2 entities as 1 in Autocad .net

I'm making an autocad plugin and i want to create a new entity that is a combination of a line and the text.If i select the line the text is selected and backwords when i delete the line delete the text etc etc.How to treat them as one object referencing eachother?Is this possible?
I recommend using groups. Below is a link on how to access groups, I'm sure that site has more information on creating groups.
Users can control whether objects are selected with the group based on the system variable, PICKSTYLE. you can use ctrl+ h to toggle the PICKSTYLE value.
http://adndevblog.typepad.com/autocad/2012/04/how-to-detect-whether-entity-is-belong-to-any-group-or-not.html
Another option - though it doesn't answer your question - and this is something for you to think about: is to create a new block which consists of the line and some text. The line can be an entity in your block, and the text can be a tag string value. the tag can be called "line_information".
I know this might be abit too late but there is a better more flexible way to do this, although it's not actually combining the two entities but rather more of a visual effect.
It's called using Overrules. Basically you change the way the entity is displayed. So instead of displaying a line, you can display a circle, or in your case display a text and a line.
Overruling is a very powerful tool, you can not only change how the entity looks but also add grips, remove grips, change how entity is highlighted or highlight other entities when your entity is highlighted, override some of the entity methods like erase and much more.
Best place to start from is Kean Walmsley's "Through the Interface" blog.
And here is a link to this blog related to what you want to achieve
http://through-the-interface.typepad.com/through_the_interface/2009/08/a-simple-overrule-to-change-the-way-autocad-lines-are-displayed-using-net.html

Categories

Resources