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

Weird issue when creating a Text Label attached to an element within a Group/Component #1004

Open
Fredosixx opened this issue Oct 6, 2024 · 2 comments

Comments

@Fredosixx
Copy link

Fredosixx commented Oct 6, 2024

The following script creates a Text Label attached to an Edge within a Group.

Here is the situation before running the script (just a group and an edge)
image

After running the script. The Arrow Leader is wrongly positioned
image

However, if you enter the group, the arrow leader is actually well positioned.
image

Attached is the model and the script. Just run test_text_label in the Ruby console.

def test_text_label
	#Find the group and its edge in the model
	model = Sketchup.active_model
	group, = model.entities.grep(Sketchup::Group)
	ee = group.entities
	edge, = ee.grep(Sketchup::Edge)
	
	#Start the operation
	model.start_operation 'Test Text Label', true
	
	#Create the Text label
	anchor = edge.start.position
	vector = Geom::Vector3d.new 50, 50, 0	
	text_label = ee.add_text 'Some Text', anchor, vector
	
	#Attach the text label to the start of the edge
	ipath = Sketchup::InstancePath.new [group, edge]
	text_label.attached_to = [ipath, anchor]
	
	#Commit Operation
	model.commit_operation
end

Note:

  • This happens in SU2022, SU2023 and SU2024, on Windows and Mac
  • If you create the Text label manually, this does not happen

Bug TextLabel.zip

Bug.Text.Label.within.Group.mp4
@Fredosixx
Copy link
Author

Additional information:

It seems that Sketchup does not like the Text Label as created by the script.

Running the validity Check, we get this message (and the text label is deleted at Save).

image

Cutting the Text Label and then pasting it in place restores a text label visually correct.

@sketchup
Copy link

sketchup bot commented Oct 14, 2024

Logged as: SKEXT-4329

@sketchup sketchup bot added the logged label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants