Block.Boundingbox for text shows incorrect values
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- computer-graphics
Research direction
Start by reproducing the report with the attached DWG files and the supplied C# example, focusing on Insert.GetBoundingBox() for a block containing text but no lines. Compare the returned height and width with the expected bounds; the issue does not name a test or source file.
Written by the indexing model from the issue text.
Description
Hi Dom,
I have inserted a block and tried to find its boundingbox of height and width. it is working fine when it has lines but if it has only text then it shows incorrect values. Can you check this issue.
string TEMPpath = @"D:\Tools Development\ACAD\Text Bounding Box\empty.dwg";
String Docpath = @"D:\Tools Development\ACAD\Text Bounding Box\DIP-SWITCH-SETTING-NOTE.dwg";
string outpath1 = @"D:\Tools Development\ACAD\Text Bounding Box\textboundingbox.dwg";
CadDocument template = DwgReader.Read(TEMPpath, onNotification);
var insertpoint = new XYZ(25, 250, 0.0);
var blockInsert = InsertBlock(Docpath, insertpoint);
Insert InsertBlock(string path, XYZ insertpoint)
{
CadDocument doc = DwgReader.Read(Docpath, onNotification);
BlockRecord newBlock = new BlockRecord("New block");
foreach (var ent in doc.Entities)
{
var entclone = ent.Clone() as Entity;
newBlock.Entities.Add(entclone);
}
template.BlockRecords.Add(newBlock);
var base1 = newBlock.BlockEntity.BasePoint;
var base2 = doc.Header.ModelSpaceInsertionBase;
newBlock.BlockEntity.BasePoint = base2;
var blockInsert = new ACadSharp.Entities.Insert(newBlock)
{
InsertPoint = insertpoint // Set the insertion point
};
return blockInsert;
}
blockInsert.Block.IsExplodable = true;
template.Entities.Add(blockInsert);
var bbox = blockInsert.GetBoundingBox();
var Height = bbox.Height;
var Width= bbox.Width;
DwgWriter.Write(outpath1, template);
- Dominant language
- C#
- Stars
- 873
- Forks
- 223
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DomCR/ACadSharp
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DWG writer: text styles get the text-style table as their xref block handlePossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
DwgWriter writes a null shape-file handle for SHAPE entities (WriteShapes = true)Possibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DwgReader reads a color-book entity's Color as ByBlock instead of the book's colorPossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
Similar issues
-
hand-to-AI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug python
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
Maintainers usually reply within 13 days