Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to insert drawings.. [modified]

How to insert drawings.. [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicshelptutorial
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Shah Satish

    Hi !!! In my application, I want to create one dialog box.Which contain 2 small box. One box will contain name of the components and second box will show preview of the selected component. Like..Box1 contain. 1.Vessel. 2.Tank. 3.Pump. 4.Nozzle. 5.Exchanger. 6.Fan. Box 2.. Which show preview of the selected item. like if I will select Fan from the box 1 then it will show me Symbol( .dwg ) of the Fan. I have collected all symbol (.dwg) for all components.. Now my question is.. 1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application. 2.How can i show preview ?? Any class or method?? Please help me ... Thanking you.. Satish

    C Offline
    C Offline
    Cedric Moonen
    wrote on last edited by
    #3

    I don't know your answer but one point is that if you want to display drawing from autocad (.dwg files if I understood it well), you'll need a libraray (or whatever) that can read these files. So, maybe that could be a good starting point: finding how you will load these files.


    Cédric Moonen Software developer
    Charting control [v1.1]

    S 1 Reply Last reply
    0
    • S Shah Satish

      Hi !!! In my application, I want to create one dialog box.Which contain 2 small box. One box will contain name of the components and second box will show preview of the selected component. Like..Box1 contain. 1.Vessel. 2.Tank. 3.Pump. 4.Nozzle. 5.Exchanger. 6.Fan. Box 2.. Which show preview of the selected item. like if I will select Fan from the box 1 then it will show me Symbol( .dwg ) of the Fan. I have collected all symbol (.dwg) for all components.. Now my question is.. 1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application. 2.How can i show preview ?? Any class or method?? Please help me ... Thanking you.. Satish

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #4

      Shah Satish wrote:

      1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application.

      Does AutoCAD have some sort of ActiveX control? If not, you'll need to convert the drawings to something that Windows can recognize (e.g., GIF, BMP, JPEG) natively.


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      S 2 Replies Last reply
      0
      • D David Crow

        Shah Satish wrote:

        1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application.

        Does AutoCAD have some sort of ActiveX control? If not, you'll need to convert the drawings to something that Windows can recognize (e.g., GIF, BMP, JPEG) natively.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        S Offline
        S Offline
        Shah Satish
        wrote on last edited by
        #5

        Thanks for mail.. but How its possible..Because its not possible to convert .dwg to .bmp..Do u have any ideaa ?? Its possible to convert in .sld (slide ) format but then could window recognize it ?? Shah

        1 Reply Last reply
        0
        • C Cedric Moonen

          I don't know your answer but one point is that if you want to display drawing from autocad (.dwg files if I understood it well), you'll need a libraray (or whatever) that can read these files. So, maybe that could be a good starting point: finding how you will load these files.


          Cédric Moonen Software developer
          Charting control [v1.1]

          S Offline
          S Offline
          Shah Satish
          wrote on last edited by
          #6

          I tried but could not found thats why i asked question in this forum..Do u have any bit idea about it ?

          1 Reply Last reply
          0
          • S Shah Satish

            Hi !!! In my application, I want to create one dialog box.Which contain 2 small box. One box will contain name of the components and second box will show preview of the selected component. Like..Box1 contain. 1.Vessel. 2.Tank. 3.Pump. 4.Nozzle. 5.Exchanger. 6.Fan. Box 2.. Which show preview of the selected item. like if I will select Fan from the box 1 then it will show me Symbol( .dwg ) of the Fan. I have collected all symbol (.dwg) for all components.. Now my question is.. 1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application. 2.How can i show preview ?? Any class or method?? Please help me ... Thanking you.. Satish

            B Offline
            B Offline
            beko
            wrote on last edited by
            #7

            Hello, In order to read AutoCAD Dwg files you need a library, DWG files must be analysed in order to write a reader and it should work for different versions (Since it is not documented). You can export drawings as DXF and read it. DXF Format is documented and there are libraries that you can use (DICE, one in OpenSceneGraph)or you can write on your own. However, there is also a library which does that for you (but you gotta get a license) searh for dwg library on Internet. By the way, Autocad can export bitmap with bmpout command. As suggested earlier, you may use ActiveX, i dont have much experience on this, however that might be possible, Autocad provides libraries and controls for .NET VB/VC++ applications, search for ARX but your AutoCAD and Visual Studio versions must be compatible. (For example Autocad 2007 needs VS2005) Hope this helps. Bekir.

            S 1 Reply Last reply
            0
            • B beko

              Hello, In order to read AutoCAD Dwg files you need a library, DWG files must be analysed in order to write a reader and it should work for different versions (Since it is not documented). You can export drawings as DXF and read it. DXF Format is documented and there are libraries that you can use (DICE, one in OpenSceneGraph)or you can write on your own. However, there is also a library which does that for you (but you gotta get a license) searh for dwg library on Internet. By the way, Autocad can export bitmap with bmpout command. As suggested earlier, you may use ActiveX, i dont have much experience on this, however that might be possible, Autocad provides libraries and controls for .NET VB/VC++ applications, search for ARX but your AutoCAD and Visual Studio versions must be compatible. (For example Autocad 2007 needs VS2005) Hope this helps. Bekir.

              S Offline
              S Offline
              Shah Satish
              wrote on last edited by
              #8

              Hi !!! Thanks for your mail..Let see..

              1 Reply Last reply
              0
              • D David Crow

                Shah Satish wrote:

                1. How can I insert my all .dwg ( autocad drawing)..I.e. which method or class should i used for insert the drawing in my application.

                Does AutoCAD have some sort of ActiveX control? If not, you'll need to convert the drawings to something that Windows can recognize (e.g., GIF, BMP, JPEG) natively.


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                S Offline
                S Offline
                Shah Satish
                wrote on last edited by
                #9

                Yeh..It is possible to convert from .dwg to .bmp..But then it is possible to make preview ?? if yes then please suggest me how.. if u have any code then please send it. Thanks

                D 1 Reply Last reply
                0
                • S Shah Satish

                  Yeh..It is possible to convert from .dwg to .bmp..But then it is possible to make preview ?? if yes then please suggest me how.. if u have any code then please send it. Thanks

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #10

                  Shah Satish wrote:

                  But then it is possible to make preview ??

                  There are several ways of displaying a .bmp file on a dialog. For example, use a static control with the SS_BITMAP style.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  S 1 Reply Last reply
                  0
                  • D David Crow

                    Shah Satish wrote:

                    But then it is possible to make preview ??

                    There are several ways of displaying a .bmp file on a dialog. For example, use a static control with the SS_BITMAP style.


                    "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                    "Judge not by the eye but by the heart." - Native American Proverb

                    S Offline
                    S Offline
                    Shah Satish
                    wrote on last edited by
                    #11

                    But it is possible to display no of .bmp file ??( I have appr more than 100 .dwg file)ie if i will convert it from .dwg to .bmp then i have more than 100 BMP file..

                    D 1 Reply Last reply
                    0
                    • S Shah Satish

                      But it is possible to display no of .bmp file ??( I have appr more than 100 .dwg file)ie if i will convert it from .dwg to .bmp then i have more than 100 BMP file..

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #12

                      If you needed to show more than one at a time, you could use a list box with the LBS_OWNERDRAWFIXED style.


                      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                      "Judge not by the eye but by the heart." - Native American Proverb

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups