{"id":22961,"date":"2019-03-06T10:00:39","date_gmt":"2019-03-06T15:00:39","guid":{"rendered":"https:\/\/blogs.solidworks.com\/tech\/?p=22961"},"modified":"2019-03-06T09:43:29","modified_gmt":"2019-03-06T14:43:29","slug":"interactive-web-content-from-solidworks-composer","status":"publish","type":"post","link":"https:\/\/blogs.solidworks.com\/tech\/2019\/03\/interactive-web-content-from-solidworks-composer.html","title":{"rendered":"Interactive Web Content from SOLIDWORKS Composer"},"content":{"rendered":"<p>Finding a replacement part can often be a hassle, even for the simplest of products.\u00a0 Calling up customer service and trying to decipher exactly what widget you are attempting to order can be next to impossible without having the unique SKU or Part Number needed.\u00a0 Seriously, who has that on hand?!\u00a0 Luckily, SOLIDWORKS Composer has an easy way to generate interactive 2D web content that can help probe into assemblies to perfectly identify these parts\u00a0<a href=\"https:\/\/www.sw-composer.com\/Interactive%20Home.html\">(check out these examples).<\/a>\u00a0 This blog post will walk you through the four steps to create these interactive images from your CAD data.<\/p>\n<p><a href=\"https:\/\/www.sw-composer.com\/Interactive%20Home.html\"><img decoding=\"async\" class=\"aligncenter wp-image-22965 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Highlighting-gif.gif\" alt=\"\" width=\"60%\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The process of creating Interactive content really comes down to 4 simple steps:<\/p>\n<ol>\n<li><strong>Create Views<\/strong><\/li>\n<li><strong>Create Links<\/strong><\/li>\n<li><strong>Export Images as SVG<\/strong><\/li>\n<li><strong>Embed to HTML<\/strong><\/li>\n<\/ol>\n<h4><\/h4>\n<h1>STEP ONE: CREATE VIEWS<\/h1>\n<p>Let\u2019s take a look of these for steps a little closer starting with capturing your interactive images in SOLIDWORKS Composer. Hot spots can be really handy for selecting sub-assemblies from the top level assembly that will be the starting point. Determine how you plan to break up your assemblies to easily navigate.\u00a0 \u00a0Each hotspot can have its own unique color by locating the hotspot and overriding the default color option. I also recommend renaming these hotspots to be descriptive of the sub-assembly, these callouts are visible on the tooltip when hovering over.<\/p>\n<figure id=\"attachment_22967\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22967\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots-615x345.png\" alt=\"\" width=\"554\" height=\"311\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots-615x345.png 615w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots-300x168.png 300w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots-768x431.png 768w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots-728x409.png 728w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hotspots.png 948w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><figcaption class=\"caption wp-caption-text\">Assigning Sub-assembly Hotspots<\/figcaption><\/figure>\n<figure id=\"attachment_22966\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22966\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hot-Spot-Properties.png\" alt=\"\" width=\"629\" height=\"305\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hot-Spot-Properties.png 503w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Hot-Spot-Properties-300x146.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><figcaption class=\"caption wp-caption-text\">Hotspot Properties<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>I selected the battery pack from this assembly and create another view (the links to connect the views will be added in the second step so you don&#8217;t have to worry about that right now).\u00a0 Using the transform tools, it\u2019s easy to create an exploded view.\u00a0 Often with more simplified sub-assemblies this will be enough to address finding the appropriate part, especially with an interactive Bill of Materials created. It&#8217;s a simple process so might as well attach one to each exploded view you create.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-22977\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Exploded-View-1.gif\" alt=\"\" width=\"60%\" \/><\/p>\n<h3>Creating a BOM from an Exploded View<\/h3>\n<ol>\n<li>Create a BOM from selections\n<ul>\n<li>You will need to window select the exploded items to include<\/li>\n<\/ul>\n<\/li>\n<li>Generate BOM ID\u2019s<\/li>\n<li>Create Balloons<\/li>\n<li>Show\/Hide BOM Table<\/li>\n<\/ol>\n<p>Of course, these all have custom properties worth playing around to give a nice final look, so spend some time familiarizing yourself with these.\u00a0 ALWAYS enable BOM highlighting to get the feedback between the exploded view and the actual table.\u00a0 I generally size up the text, change the style to parametric and add some shading to the table itself, but really it comes down to user preference.<\/p>\n<figure id=\"attachment_22979\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22979 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2.png\" alt=\"\" width=\"950\" height=\"530\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2.png 950w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2-300x167.png 300w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2-768x428.png 768w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2-615x343.png 615w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-2-728x406.png 728w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><figcaption class=\"caption wp-caption-text\">Interactive BOM\/Parts List<\/figcaption><\/figure>\n<figure id=\"attachment_22978\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22978 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-properties.png\" alt=\"\" width=\"504\" height=\"478\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-properties.png 504w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/BOM-properties-300x285.png 300w\" sizes=\"auto, (max-width: 504px) 100vw, 504px\" \/><figcaption class=\"caption wp-caption-text\">BOM Properties<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Generate Single Part Views Quickly<\/h3>\n<p>It\u2019s a pretty quick process to build views for each individual part from the exploded views you have created. Start by right clicking on a part from the sub assembly exploded view and selecting the \u2018Show Selection and Hide Others\u2019 will get you there in one step.\u00a0 Then just snapshot the view and move back to the explode view to repeat this process.\u00a0 Really what we are trying to accomplish in this first step is taking a snapshot of each sub-assembly and then each part if you want to provide that much depth to your end user.\u00a0 Some instances, the interactive BOM is enough, in others you may want to go the extra step down to the single part.<\/p>\n<figure id=\"attachment_22972\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22972 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Show-Selection-and-Hide-Others.png\" alt=\"\" width=\"410\" height=\"266\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Show-Selection-and-Hide-Others.png 410w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Show-Selection-and-Hide-Others-300x195.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><figcaption class=\"caption wp-caption-text\">Show Selection and Hide Others<\/figcaption><\/figure>\n<figure id=\"attachment_22974\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22974\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views.png\" alt=\"\" width=\"406\" height=\"344\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views.png 966w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views-300x254.png 300w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views-768x650.png 768w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views-615x521.png 615w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Views-728x616.png 728w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><figcaption class=\"caption wp-caption-text\">All Part, Assembly and Sub-Assembly Views<\/figcaption><\/figure>\n<h3>Add Web Buttons<\/h3>\n<p>This is also a good opportunity to add any supporting images to the views that you are capturing.<\/p>\n<p><strong>Pro tip: <\/strong>Grab common icons to compliment what Composer comes with in the installation.\u00a0 Home, back, forward, different views, anything that might add to the navigation can all be done in 2D image format and added to your image library from the Workshops.<\/p>\n<figure id=\"attachment_22969\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22969\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop-580x615.png\" alt=\"\" width=\"506\" height=\"537\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop-580x615.png 580w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop-283x300.png 283w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop-768x814.png 768w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop-728x772.png 728w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Image-Workshop.png 829w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><figcaption class=\"caption wp-caption-text\">Custom 2D Library<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2>STEP TWO: Create Links<\/h2>\n<p>This gets us to the second step, creating the links.\u00a0 Links can be created FROM just about anything TO just about anything.\u00a0 For this type of content, a link from our defined hotspots for assemblies and parts for exploded views to the appropriate view is all we need. So essentially, drilling down from the top level, to sub assemblies, to exploded views to finally the final part.<\/p>\n<p><strong>Now here is the secret sauce: instead of linking to the VIEW itself, you will link it to SVG file that will be created from that view.<\/strong>\u00a0 For example, from the main menu I will create a link from the battery pack hotspot to the \u2018battery_pack.svg.\u2019\u00a0 We will be creating these files in the next step when exporting the svg files themselves.\u00a0 These links get created inside of the SVG files when the vector image files are created. Once loaded online or tested locally (I recommend Chrome), everything should work seamless as long as they are in the same root directory.<\/p>\n<figure id=\"attachment_22970\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22970 size-large\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links-615x376.png\" alt=\"\" width=\"615\" height=\"376\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links-615x376.png 615w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links-300x183.png 300w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links-768x470.png 768w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links-728x445.png 728w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Part-Links.png 875w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><figcaption class=\"caption wp-caption-text\">Creating SVG Links<\/figcaption><\/figure>\n<p>Now that you have created your links and updated all the views, it\u2019s time to start saving the SVG files.\u00a0 I like to do a series of test images to make sure the final images will look good.\u00a0 Under the workshops in technical illustrations you can refine line weights, add\/remove color and change the outline styles and test the final svg image through the preview button.\u00a0 Here are the settings that I generally use for black and white SVG output:<\/p>\n<figure id=\"attachment_22971\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22971 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Recommended-svg-output-settings.png\" alt=\"\" width=\"438\" height=\"468\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Recommended-svg-output-settings.png 438w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Recommended-svg-output-settings-281x300.png 281w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><figcaption class=\"caption wp-caption-text\">Recommended SVG Output Settings<\/figcaption><\/figure>\n<h2>STEP THREE: Export Images as SVG<\/h2>\n<p>Next is step three, exporting the SVG files to a common directory.\u00a0 I use a \u2018_svg\u2019 subfolder in the same location that the HTML files are being saved.\u00a0 This makes it easy to reference the \u2018main menu\u2019 SVG file that will then reference all the subsequent svg files.\u00a0 When you are saving these images out, Composer will also create a series of sub folders in that same location to save out any supporting images (like the navigation icons I mentioned above).\u00a0 Keep these files in this directory as well.\u00a0 Each supporting 2D image get a new name and are referenced in the SVG file.\u00a0 <em>You COULD create a single image instance if an image is used more than one, but would have to find and rename in the SVG and really isn\u2019t worth the extra time to save a few kilobytes of space.<\/em><\/p>\n<figure id=\"attachment_22973\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22973 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/SVG-and-Sub-Folders.png\" alt=\"\" width=\"413\" height=\"280\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/SVG-and-Sub-Folders.png 413w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/SVG-and-Sub-Folders-300x203.png 300w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><figcaption class=\"caption wp-caption-text\">Retaining Exported Images in HTML Directory<\/figcaption><\/figure>\n<p>That\u2019s it for the interactive content creation.\u00a0 At this point, you should be able to open your first image, in this case I named the first SVG that I want my end user to start with \u201cMyomo Home.svg.\u201d\u00a0 Since all the links created reference the additional SVG files, they will open the next image in the browser.\u00a0 Start testing and make sure all of you links are valid.<\/p>\n<p>If you see that they are NOT working, check in Composer that the link is indeed pointing to the SVG file in the correct location, and I also uncheck the \u2018Pack Linked Resource\u2019 in the event properties to keep the SVG files separate.\u00a0 This makes updating files an easier process.<\/p>\n<figure id=\"attachment_22964\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22964 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Event-Properties.png\" alt=\"\" width=\"478\" height=\"75\" srcset=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Event-Properties.png 478w, https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/Event-Properties-300x47.png 300w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><figcaption class=\"caption wp-caption-text\">Uncheck &#8216;Packed link resource&#8217;<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2>STEP FOUR: Embed to HTML<\/h2>\n<p>Now it\u2019s just the last step, adding your HTML line of code to reference the SVG file and upload to the hosting service.\u00a0 Of course, a google search how to add an SVG link the HTML, but the basic line needed is just this (your syntax will be different):<\/p>\n<p style=\"text-align: center;\"><strong>&lt;object data=\u201d_svg\/myomo home.svg\u201d type=\u201d\u201dimage\/svg+xml\u201d width=\u201d80%\u201d&gt;<\/strong><\/p>\n<p>The object data in this case is pointing to the sub folder in the directory where I saved all of my SVG files, hence the _svg\/.\u00a0 Then just the name of the \u2018main menu\u2019 or \u2018home\u2019 svg you want the end user to start with \u201cmyomo_home.svg.\u201d\u00a0 I added the width percentage, use a percent of the viewable page vs a pixel definition so the svg files will be responsive.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_22968\" class=\"thumbnail wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22968 size-full\" src=\"https:\/\/blog-assets.solidworks.com\/uploads\/sites\/4\/HTML-Code.png\" alt=\"\" width=\"900\" height=\"359\" \/><figcaption class=\"caption wp-caption-text\">Example HTML Code<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>The process is really pretty simple once you run through it.\u00a0 Almost all of your time is in the capturing of images and creation of links.\u00a0 The HTML side is just one single line of code to bring in that first SVG file that will reference the rest.\u00a0 So with little effort and the help of SOLIDWORKS Composer you can build some really cool interactive online content (and not just limited to parts catalogs).\u00a0 Now go ahead and give it a try!\u00a0 To learn more on how SOLIDWORKS Composer can help streamline technical publications, like installation manuals, assembly instructions with easy to follow visuals, give your local reseller a call today.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finding a replacement part can often be a hassle, even for the simplest of products.\u00a0 Calling up customer service and trying to decipher exactly what widget you are attempting to order can be next to impossible without having the unique<\/p>\n... <a href=\"https:\/\/blogs.solidworks.com\/tech\/2019\/03\/interactive-web-content-from-solidworks-composer.html\">Continued<\/a>","protected":false},"author":304,"featured_media":23197,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2507,23],"tags":[178,1871,2536,60,144,62],"class_list":["post-22961","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solidworks-2019","category-solidworks-composer","tag-composer","tag-parts-catalog","tag-svg","tag-tech-tip","tag-tech-tips","tag-technical-tips"],"acf":[],"_links":{"self":[{"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/posts\/22961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/users\/304"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/comments?post=22961"}],"version-history":[{"count":6,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/posts\/22961\/revisions"}],"predecessor-version":[{"id":23198,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/posts\/22961\/revisions\/23198"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/media\/23197"}],"wp:attachment":[{"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/media?parent=22961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/categories?post=22961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.solidworks.com\/tech\/wp-json\/wp\/v2\/tags?post=22961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}