This forum is for Revit API/Programming questions - not for product question

This forum is for Revit API/Programming questions - not for product question

mikako_harada
Community Manager Community Manager
1,698 Views
13 Replies
Message 1 of 14

This forum is for Revit API/Programming questions - not for product question

mikako_harada
Community Manager
Community Manager

Dear Community,

 

Revit API forum is for API (Application Programming Interface) questions.

 

For non-API questions, please choose other forums that is more appropriate. For example,

 

Installation and licensing:

http://forums.autodesk.com/t5/installation-licensing/bd-p/24

 

Revit Architecture:

http://forums.autodesk.com/t5/revit-architecture/bd-p/133

(This may include platform product usage questions) 

 

Revit Structure:

http://forums.autodesk.com/t5/revit-structure/bd-p/153

 

Revit MEP:

http://forums.autodesk.com/t5/revit-mep/bd-p/188

 

 

We have received a couple of feedback from our API community expressing that this forum is used for unintended purposes occasionally.

So just wanted to add a note about the purpose of this Forum. 

 

We appreciate your understanding and cooperation.

 

Regards, 


Mikako Harada
Developer Technical Services
1,699 Views
13 Replies
Replies (13)
Message 2 of 14

Revitalizer
Advisor
Advisor

Dear ADN Team,

 

I would display the posting's title in UPPERCASE 😉

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 3 of 14

Anonymous
Not applicable
yes, and make it bling bling, shining brightly so it's the first thing you'll see when you look at this forum. And make an option for people with 0 posts, that when they create a new post, a messagebox appears every 5 seconds asking if it's really and APi related question they are posting here 🙂
Message 4 of 14

mikako_harada
Community Manager
Community Manager

Sounds like you are still seeing non-API questions.  I just added "not for product questions".  Unfortunately, I cannot do anything fancy like finding out the new member.  

 

One thing you may be able to help those is to report a wrong post by using options:

 

  1. on the upper right of each post, there is a pulldown options menu. You can choose "Report Inappropriate Content",
  2. then in the comment, write the resaon why inappropriate. i.e., wrong forum.
    It will be also kind to point to the right one, such as Revit xxx or Installation and Licensing (which I myself found only recently that a separate forum exists.) 

If you don't see anybody responding to the request, please add a comment here. I will try to contact the group who manages the backend system. 

 

Thank you for your patience and your contribution!


Mikako Harada
Developer Technical Services
0 Likes
Message 5 of 14

Anonymous
Not applicable

Hi,

 

following the examples in Revit API 2015 for ItemFactoryBase.NewModelCurve Method and I'm having an exception stating curve must be in plane.

 

Below is my macro code based on the API exampe:

 

public void createLine()
{
	UIDocument uidoc = this.ActiveUIDocument;			
	Document doc = uidoc.Document;
	Application app = doc.Application;			
			
	XYZ startingPoint = new XYZ(0,0,0);
	XYZ endPoint = new XYZ(10,10,0);
	Line l = Line.CreateBound(startingPoint, endPoint);
			
	XYZ end0 = new XYZ(1,0,0);
	XYZ end1 = new XYZ(10,10,10);
	XYZ pc = new XYZ(10,0,0);
	Arc a = Arc.Create(end0,end1,pc);
			
	XYZ origin = new XYZ(0,0,0);
	XYZ normal = new XYZ(1,1,0);			
			
	Plane p = app.Create.NewPlane(normal, origin);
			
	try
	{		
		using(Transaction t = new Transaction(doc, "making a line"))
		{
			t.Start();				
			SketchPlane skp = SketchPlane.Create(doc, p);				
			ModelLine ml = doc.Create.NewModelCurve(l, skp) as ModelLine;
			t.Commit();	
		}
	}
	catch(Exception e)
	{
		TaskDialog.Show("error", "Cannot create a line.\nDetails: \n" +
				                e.Message);
	}			
}

 What am I missing?

Any help is greatly appreciated.

0 Likes
Message 6 of 14

Revitalizer
Advisor
Advisor

Hi,

 

use

XYZ normal = new XYZ(1,0,0);   

 

Best regarss,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 7 of 14

Anonymous
Not applicable

thanks for the reply. but still. its not working. still having error that curve must be in the plane even though I already changed to  XYZ normal = new XYZ(1,0,0);    

0 Likes
Message 8 of 14

Revitalizer
Advisor
Advisor

Hi,

 

excuse my error.

Normal must be 0/0/1 since it directs upwards.

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 9 of 14

Anonymous
Not applicable

That worked!

 

XYZ normal = new XYZ(0,0,1);

 Thank you!

 

p.s., someone has to update the chm 😉

0 Likes
Message 10 of 14

Anonymous
Not applicable

another solution based on Revitalizer's suggestion:

 

XYZ normal = doc.ActiveView.ViewDirection;

 thanks again!

0 Likes
Message 11 of 14

Revitalizer
Advisor
Advisor

Dear anagnam,

 

the normal vector of the plane depends on your line's geometry, so both view.ViewDirection and 0/0/1 are solutions for just this case.

I recommend to learn more about vector maths.

 

Alternatively, there are examples for drawing model curves on the TBC blog, e.g.:

http://thebuildingcoder.typepad.com/blog/2015/04/curved-wall-elevation-profile-and-creator-class-upd...

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 12 of 14

ollikat
Collaborator
Collaborator
*LOL*

I don't know whether it's ironic or what...but it's quite awkward that THE discussion thread which tries to instruct keeping the forum clean is polluted by non related discussion X-D.
Message 13 of 14

Revitalizer
Advisor
Advisor

Dear ollikat,

 

you are absolutely right,

it was a mistake to answer the question instead of pointing out that this is the false thread.

 

@Admins: please delete or move the off-thread postings to keep the forum clean.

 

Revitalizer

 




Rudolf Honke
Software Developer
Mensch und Maschine





Message 14 of 14

mikako_harada
Community Manager
Community Manager

Dear community,

 

Thank you for rightly pointing out about our intention of keeping our forum "clean" and logically organized as our accumurated, long lasting knowledge base. 

 

I will pull this out from the float at the top, and write another one explaining what this forum is about. 


Mikako Harada
Developer Technical Services