Hello,
Sorry if this topic is solved I've been searching for a while without success.
So here is what I want to do :
- I have a CurveLoop which is valid to crop my active view
- I create a new ViewPlan
- I want to crop it
Everything works fine except the last.
Here is my code :
using (Transaction t = new Transaction(uidoc.Document, "Renomme les vues selectionnees"))
{
t.Start();
ViewPlan maVue = ViewPlan.Create(doc, floorPlanId, doc.ActiveView.GenLevel.Id);
// Appliquer un gabarit sur ma vue (viewTemplate), changer son nom, etc...
// On crope
ViewCropRegionShapeManager vcrShapeMgr = maVue.GetCropRegionShapeManager();
if (vcrShapeMgr.CanHaveShape) vcrShapeMgr.SetCropShape(cl); else TaskDialog.Show("r", "Je ne peux pas croper à la forme demandée");
t.Commit();
}
Another question: I would like to set my view name and apply a view Template to my new view. I can't find out how.
Thanks
Benoit
Solved! Go to Solution.
Hello,
Sorry if this topic is solved I've been searching for a while without success.
So here is what I want to do :
- I have a CurveLoop which is valid to crop my active view
- I create a new ViewPlan
- I want to crop it
Everything works fine except the last.
Here is my code :
using (Transaction t = new Transaction(uidoc.Document, "Renomme les vues selectionnees"))
{
t.Start();
ViewPlan maVue = ViewPlan.Create(doc, floorPlanId, doc.ActiveView.GenLevel.Id);
// Appliquer un gabarit sur ma vue (viewTemplate), changer son nom, etc...
// On crope
ViewCropRegionShapeManager vcrShapeMgr = maVue.GetCropRegionShapeManager();
if (vcrShapeMgr.CanHaveShape) vcrShapeMgr.SetCropShape(cl); else TaskDialog.Show("r", "Je ne peux pas croper à la forme demandée");
t.Commit();
}
Another question: I would like to set my view name and apply a view Template to my new view. I can't find out how.
Thanks
Benoit
Solved! Go to Solution.
Solved by RPTHOMAS108. Go to Solution.
I forgot to add that the problem is that my crop region is not a rectangle, so the parameter vcrShapeMgr.CanHaveShape is false. Which is my problem...
I forgot to add that the problem is that my crop region is not a rectangle, so the parameter vcrShapeMgr.CanHaveShape is false. Which is my problem...
I believe when you are working with a newly created view the .CanHaveShape property will be set to false until you have first made the crop region visible.
Visibility and active status can be set via properties of the class:
View.CropBoxVisible = True
View.CropBoxActive =True
Do the above first in a subtransaction and then you should be able to apply a shape.
ViewTemplates are indicated by built in parameters:
VIEW_TEMPLATE_FOR_SCHEDULE
VIEW_TEMPLATE
These can be set by the property of the class e.g. View.ViewTemplateID
View templates are objects in the database which share the same class as the views they can be applied to i.e. ViewPlan will have a property ViewPlan.IsTemplate to identify that object as a template not a view. When filtering for actual views you should also be wary of this property.
ViewName can be edited after view is created via the class property View.ViewName.
If a template has been applied then some of the above will be governed by the template (not able to set them in the view). e.g. cropbox may have been set to a scopebox in the template.
I believe when you are working with a newly created view the .CanHaveShape property will be set to false until you have first made the crop region visible.
Visibility and active status can be set via properties of the class:
View.CropBoxVisible = True
View.CropBoxActive =True
Do the above first in a subtransaction and then you should be able to apply a shape.
ViewTemplates are indicated by built in parameters:
VIEW_TEMPLATE_FOR_SCHEDULE
VIEW_TEMPLATE
These can be set by the property of the class e.g. View.ViewTemplateID
View templates are objects in the database which share the same class as the views they can be applied to i.e. ViewPlan will have a property ViewPlan.IsTemplate to identify that object as a template not a view. When filtering for actual views you should also be wary of this property.
ViewName can be edited after view is created via the class property View.ViewName.
If a template has been applied then some of the above will be governed by the template (not able to set them in the view). e.g. cropbox may have been set to a scopebox in the template.
Thank you very much !!
I am trying these solutions right away !!
I believe the Building Coder could spend a post on this topic, don't you ?
Benoit
Thank you very much !!
I am trying these solutions right away !!
I believe the Building Coder could spend a post on this topic, don't you ?
Benoit
Can't find what you're looking for? Ask the community or share your knowledge.