Aller au contenu

Johnny_w

Membres
  • Compteur de contenus

    4
  • Inscription

  • Dernière visite

Tout ce qui a été posté par Johnny_w

  1. Salut, je ne crois pas qu'il soit possible de mettre un bloc dynamique avec attribut à l’échelle en fonction d'un paramètre car l'éditeur de table de code ne permet aucune action à partir d'un attribut. Dans ma table, j'ai un code qui insère un bloc à l’échelle 1 avec un attribut à renseigner (diamètre), un code qui insère un bloc à l’échelle en fonction de la valeur saisie et un autre qui ajoute un attribut "diamètre" au bloc. Ce qui oblige à taper deux codes pour avoir l'info et le bloc à l'échelle. Si il souhaite vraiment automatiser la mise à l’échelle de ses arbres en fonction de leurs diamètres je pense qu'un petit programme lisp à lancer après avoir générer le dessin serait plus simple à mettre en place.
  2. Salut, peut être que ce bout de code pourra t'être utile: //-------------------------------------------------------------------------- // Fonction d'insertion du bloc private static Point3d Insertion(Database db, Editor BarreCommande, ObjectId IdBlocRef) { ObjectId IdNewbloc; Point3d PtbaseEtiq = Point3d.Origin; Transaction tr = db.TransactionManager.StartTransaction(); BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForWrite); BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[blockTableRecord.ModelSpace], OpenMode.ForWrite); using (tr) { try { Point3d Position = new Point3d(0, 0, 0); BlockReference br = new BlockReference(Position, IdBlocRef); IdNewbloc = br.ObjectId; Matrix3d ucsRotation = BarreCommande.CurrentUserCoordinateSystem; ucsRotation = ucsRotation.PostMultiplyBy(Matrix3d.Displacement(ucsRotation.Translation)); br.TransformBy(ucsRotation); btr.AppendEntity(br); tr.AddNewlyCreatedDBObject(br, true); PromptSelectionResult psr = BarreCommande.SelectLast(); if (psr.Status == PromptStatus.OK) { PromptPointResult ppr = BarreCommande.Drag(psr.Value, "\nPoint d'insertion: ", delegate(Point3d pt, ref Matrix3d mat) { pt = pt.TransformBy(BarreCommande.CurrentUserCoordinateSystem); if (Position == pt) return SamplerStatus.NoChange; else { mat = Matrix3d.Displacement(br.Position.GetVectorTo(pt)); } return SamplerStatus.OK; } ); if (ppr.Status == PromptStatus.OK) { Point3d PtWCS_insert = ppr.Value.TransformBy(BarreCommande.CurrentUserCoordinateSystem); Matrix3d mat = Matrix3d.Displacement(br.Position.GetVectorTo(PtWCS_insert)); br.TransformBy(mat); PtbaseEtiq = br.Position; } } tr.Commit(); } catch (System.Exception ex) { BarreCommande.WriteMessage("\nErreur!!\n " + ex.Message + "\n"); } } return PtbaseEtiq; } // FIN FONCTION //--------------------------------------------------------------------------
  3. Salut, j'ai installé cet semaine AutoCAD Map 2013 et Covadis 13 sur des postes sous XP 32 bits et pour le moment pas de problèmes particuliers. On verra dans le temps comment ça se passe...
  4. Salut Il existe la méthode "Intersectwith" ;) . public Point3dCollection CollPt3d_Intersection(Database db, ObjectId IdA, ObjectId IdB, Editor ed) { Point3dCollection CollPt3d = new Point3dCollection(); using (Transaction tr = db.TransactionManager.StartTransaction()) { Entity EntA= tr.GetObject(IdA, OpenMode.ForRead) as Entity; Entity EntB = tr.GetObject(IdB, OpenMode.ForRead) as Entity; //Verifie si les 2 entitees s'intersectent EntiteeA.IntersectWith(EntiteeB, Autodesk.AutoCAD.DatabaseServices.Intersect.OnBothOperands, CollPt3d, IntPtr.Zero, IntPtr.Zero); ed.WriteMessage("\nNombre d'intersection trouvé: " + CollPt3d.Count); tr.Commit(); } return CollPt3d; }
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer. Politique de confidentialité