SolidWorks Two Development Learning (2) How to select a sketch and traverse all the lines in the sketch (non-sketch edit state)

Source: Internet
Author: User

1 ImportsSolidWorks.Interop.sldworks2 ImportsSolidWorks.Interop.swconst3 ImportsSystem.Runtime.InteropServices4 ImportsSystem5 6 Partial ClassSolidworksmacro7 8      Public SubMain ()9 Ten         DimSwselmgr asSelectionmgr One         DimSwdoc asMODELDOC2 = Nothing A         DimSwpart asPartdoc = Nothing -         DimBoolstatus as Boolean=False -         DimLongstatus as Integer=0 the         DimSwsketch asSketch -         DimSwfeat asFeature -         DimVsketchseg as Object -         DimSwsketchseg assketchsegment +         DimK as Integer=0 -  +Swdoc =CType(Swapp.activedoc, MODELDOC2) ABoolstatus = SwDoc.Extension.SelectByID2 ("Air_low_sketch","SKETCH",0,0,0,False,0, Nothing,0) atSwdoc =Swapp.activedoc -Swselmgr =Swdoc.selectionmanager -Swfeat = SWSELMGR.GETSELECTEDOBJECT6 (1,0) -Swsketch =Swfeat.getspecificfeature2 -Swdoc.clearselection2 (True) -Vsketchseg =swsketch.getsketchsegments in         If  not IsNothing(VSKETCHSEG) Then -              forK =0  to UBound(VSKETCHSEG) toSwsketchseg =vsketchseg (k) +Swsketchseg.selectbymark (True,0) -             Nextk the         End If *     End Sub $ Panax Notoginseng     " " <summary> -     " "The sldworks swapp variable is pre-assigned for you. the     " " </summary> +      PublicSwapp asSldworks A  the  + End Class

SolidWorks Two Development Learning (2) How to select a sketch and traverse all the lines in the sketch (non-sketch edit state)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.