Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable DwgWriter for Attribute Entities #447

Closed
DomCR opened this issue Sep 10, 2024 Discussed in #444 · 0 comments · Fixed by #449
Closed

Enable DwgWriter for Attribute Entities #447

DomCR opened this issue Sep 10, 2024 Discussed in #444 · 0 comments · Fixed by #449
Labels
bug Something isn't working

Comments

@DomCR
Copy link
Owner

DomCR commented Sep 10, 2024

Discussed in #444

Originally posted by w4l1k September 10, 2024
Hi,
how can I insert a block with attributes into the model?
I can't figure out how to do it, here is my code .
I only see the circle on the model without the text.
When I insert the block manually, the text appears.

	CadDocument doc = new(ACadVersion.AC1024);
	BlockRecord record = new("my_block");

	record.Entities.Add(new Circle
	{
		Radius = 10,
		Center = XYZ.Zero
	});

	record.Entities.Add(new AttributeDefinition()
	{
		InsertPoint = XYZ.Zero,
		Prompt = "Name ???",
		Tag = "CIRCLE_NAME",
		Value = "Circilla",
		HorizontalAlignment = TextHorizontalAlignment.Left,
		Height = 18,
		AttributeType = AttributeType.SingleLine,
	});

	doc.BlockRecords.Add(record);

	doc.Entities.Add(new Insert(record)
	{
		InsertPoint = new XYZ(100, 100, 0),
		XScale = 0.8,
		YScale = 0.8,
	});

	using DwgWriter writer = new("../../../test.dwg", doc);
	writer.OnNotification += NotificationHelper.LogConsoleNotification;
	writer.Write();</div>
@DomCR DomCR added the bug Something isn't working label Sep 10, 2024
@DomCR DomCR linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant