Copy an area of a model into another model
Wout
3/25/2019 3:23 PM
|
---|
It's here. There's no example, but should be pretty straightforward.
- Wout
|
Kai
3/26/2019 8:58 AM
|
---|
Hello,
there are troubles with including the method "GetEntitiesInRectangle".
Please have a look at the attached file.
Ist there a dll or a namespace missing?
Here my source code:
C# Code: GraphicsConfig config = new GraphicsConfig( |
Wout
3/26/2019 10:56 AM
|
---|
It's a method of class SelectInteractor, like I've written.
- Wout
|
Kai
3/26/2019 11:13 AM
|
---|
Hallo,
Gut, ich habe die Klasse gefunden.
Using Direktive "using WW.Cad.Actions;" fehlte.
Entschuldigung, mein Fehler.
Und jetzt suche ich nach den Parametern der folgenden Methode:
[csharp] EntityFilterDelegate filterDelegate = new EntityFilterDelegate (); [/ csharp]
Morgen werde ich weiter arbeiten.
Danke dir.
|
Kai
3/27/2019 7:39 AM
|
---|
Now in english!
Hello,
Good, I found the class.
Using directive "using WW.Cad.Actions;" was missing.
Sorry my fault.
And now I'm looking for the parameters of the following method:
C# Code: EntityFilterDelegate filterDelegate = new EntityFilterDelegate ( |
Kai
3/27/2019 9:58 AM
|
---|
Hello,
now I define the parameter "filterDelegate" with a null pointer.
And there is another problem with initialization the parameter "layout".
I don´t know what´s happend this.
A try catch is landing in the catch exeption with following message as output:
-> The object reference was not set to an object instance.
Here is my source code:
C# Code: if ( |
Kai
4/17/2019 12:39 PM
|
---|
Hello,
The problem still does not work.
I use the method:
[csharp] liEntityInfos = SelectInteractor.GetEntitiesInRectangle (Model, Layout, Model.Entities, Configuration, Transformation, Rectangle [i], Null); [/ csharp]
By calling the method of class DxfLayout
[csharp] layout.SetupDefaultIfNoViewportsPresent (); [/ csharp]
The program crashes.
Please see previous post from me.
What can I do to get the program up and running?
Thanks for your help.
|
Wout
4/17/2019 1:28 PM
|
---|
You must pass a filter delegate that's not null. It can be something simple as:
C# Code: EntityFilterDelegate filter = ( |
Kai
4/18/2019 5:56 AM
|
---|
Hello,
that does not work either.
Now there is a mistake in this part.
[csharp] DrawContext context = new DrawContext.Wireframe.ModelSpace (model1, config, transformation);
EntityFilterDelegate filter = (context, entity) => true; [/ csharp]
Error Code: CS0136 C # A local or a parameter named 'context' can not be declared in this scope because this name is used in a surrounding local space to define a local member or parameter
Do I have to call the method for each entity in a foreach loop?
[csharp] liEntityInfos = SelectInteractor.GetEntitiesInRectangle (Model, Layout, Model.Entities, Configuration, Transformation, Rectangle [i], Filter); [/ csharp]
Can you show me an example that works?
Thanks for your help.
|
Kai
4/18/2019 9:16 AM
|
---|
Hello,
Everything I try to do does not work.
Is there a way to find out which X, Y coordinate the entity is referenced to?
If I know the position of the entity, it's easy to clone it into another model.
If this is not the right way, I understand at least what I do.
[Csharp]
foreach (DxfEntity entity in model.Entities)
{
// Here I need the X, Y coordinate of the entity.
entity. ???????????
}
[/ csharp]
Thanks for your help
|