Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 351383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:38:19+00:00 2026-05-12T11:38:19+00:00

How can I write text entities to a dxf file? I found a script

  • 0

How can I write text entities to a dxf file?

I found a script that can export Sketchup drawings to dxf files, unfortunately it was ignoring layers and text. I fixed it so it outputs the proper layer, but I cannot figure out how to get it to output the text.

I have it to the point where it pops up a message when it comes across a text entity in the entities collection, but I’m not sure how to get it to write it to the file properly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:38:19+00:00Added an answer on May 12, 2026 at 11:38 am

    This is how I did it.

    def dxf_text_output_test
        $dxf_file = File.new("C:\testfile.dxf" , "w" ) 
        model = Sketchup.active_model
        entities = model.entities
        entities.each do |entity|
            if(entity.typename="Text")
                dxf_output_text(entity)
            end
        end
    end
    
    def dxf_ouput_text(text)
        points = text.point
        $dxf_file.puts( "  0\nTEXT\n1\n192\n330\n1F\n100\nAcDbEntity\n8\n"+text.layer.name+"\n")
        $dxf_file.puts("100\nAcDbText\n")
        if(points == nil)   
            $dxf_file.puts("10\n0.0\n")#x
            $dxf_file.puts("20\n0.0\n")#y
            $dxf_file.puts("30\n0.0\n")#z
        else
            $dxf_file.puts("10\n"+(points.x.to_f * $dxf_conv).to_s+"\n")#x
            $dxf_file.puts("20\n"+(points.y.to_f * $dxf_conv).to_s+"\n")#y
            $dxf_file.puts("30\n"+(points.z.to_f * $dxf_conv).to_s+"\n")#z
        end
        $dxf_file.puts("40\n"+(1 * $dxf_conv).to_s+"\n")#text height
        $dxf_file.puts("39\n"+text.line_weight.to_s+"\n")#thickness
        $dxf_file.puts("1\n"+text.text+"\n")#text
    end 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 215k
  • Answers 215k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The request you're sending the redirect on is not for… May 12, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer I recommend git. Either way you're going to want the… May 12, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer As an alternative, you could use the free Html Agility… May 12, 2026 at 10:54 pm

Related Questions

There is a need from a customer to log every data change to a
I have a textbox and a link button. When I write some text, select
I'm using an SqlCommand object to insert a record into a table with an
How can I write a semi transparent text on an Image (Jpg,Bmp), or a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.